[ https://issues.apache.org/jira/browse/HIVE-8494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15074988#comment-15074988 ]
pzw commented on HIVE-8494: --------------------------- I try to create a test like this: create table t(a int ,b int ,c int) partitioned by(p smallint); and then I insert sum data to the table t: insert into t partition (p=32768) values (1,2,3),(4,5,6),(7,8,9); here is the result: "select * from t" : 1 2 3 -32768 4 5 6 -32768 7 8 9 -32768 "select sum(p) from t" and "select min(p) from t" both works well. I test this in hive 1.1.0 and 1.2.0. > Hive partitioned table with smallint datatype > --------------------------------------------- > > Key: HIVE-8494 > URL: https://issues.apache.org/jira/browse/HIVE-8494 > Project: Hive > Issue Type: Bug > Components: CLI, Query Processor > Affects Versions: 0.12.0, 0.13.0, 1.1.0 > Reporter: Sudipto Nandan > Assignee: pzw > > create a hive partitioned table with partitioning column datatype smallint > col_name data_type comment > a int None > b int None > c int None > p smallint None > Partition Information > col_name data_type comment > p smallint None > Put the following data. See the partition value is 32768 - which exceeds the > smallint limit by 1 > select * from t; > a b c p > 1 2 3 32768 > 4 5 6 32768 > 7 8 9 32768 > hive> select sum(p) from t; > also works > but > hive> select min(p) from t; > fails > It should disallow creation of partition with value 32768 as it exceeds the > smallint limit (SMALLINT (2-byte signed integer, from -32,768 to 32,767) > The same issue is even with int and partition column value of 2,147,483,648 > which exceeds the int limit (INT (4-byte signed integer, from -2,147,483,648 > to 2,147,483,647)) > ) -- This message was sent by Atlassian JIRA (v6.3.4#6332)