hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1418848 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/exec/MapOperator.java test/queries/clientpositive/partInit.q test/results/clientpositive/metadataonly1.q.out test/results/clientpositive/partInit.q.out
Date Sun, 09 Dec 2012 09:21:24 GMT
Author: hashutosh
Date: Sun Dec  9 09:21:23 2012
New Revision: 1418848

URL: http://svn.apache.org/viewvc?rev=1418848&view=rev
Log:
HIVE-2794 : Aggregations without grouping should return NULL when applied to partitioning
column of a partitionless table (Navis via Ashutosh Chauhan)

Added:
    hive/trunk/ql/src/test/queries/clientpositive/partInit.q
    hive/trunk/ql/src/test/results/clientpositive/partInit.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
    hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java?rev=1418848&r1=1418847&r2=1418848&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java Sun Dec  9 09:21:23
2012
@@ -270,7 +270,8 @@ public class MapOperator extends Operato
         partNames.add(key);
         // Partitions do not exist for this table
         if (partSpec == null) {
-          partValues[i] = new Text();
+          // for partitionless table, initialize partValue to null
+          partValues[i] = null;
         } else {
           partValues[i] = new Text(partSpec.get(key));
         }

Added: hive/trunk/ql/src/test/queries/clientpositive/partInit.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/partInit.q?rev=1418848&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/partInit.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/partInit.q Sun Dec  9 09:21:23 2012
@@ -0,0 +1,7 @@
+CREATE TABLE empty (c INT) PARTITIONED BY (p INT);
+SELECT MAX(c) FROM empty;
+SELECT MAX(p) FROM empty;
+
+ALTER TABLE empty ADD PARTITION (p=1);
+SELECT MAX(p) FROM empty;
+

Modified: hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out?rev=1418848&r1=1418847&r2=1418848&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out Sun Dec  9 09:21:23
2012
@@ -81,7 +81,7 @@ PREHOOK: type: QUERY
 POSTHOOK: query: select max(ds) from TEST1
 POSTHOOK: type: QUERY
 #### A masked pattern was here ####
-
+NULL
 PREHOOK: query: alter table TEST1 add partition (ds='1')
 PREHOOK: type: ALTERTABLE_ADDPARTS
 PREHOOK: Input: default@test1

Added: hive/trunk/ql/src/test/results/clientpositive/partInit.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/partInit.q.out?rev=1418848&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/partInit.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/partInit.q.out Sun Dec  9 09:21:23 2012
@@ -0,0 +1,35 @@
+PREHOOK: query: CREATE TABLE empty (c INT) PARTITIONED BY (p INT)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE empty (c INT) PARTITIONED BY (p INT)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@empty
+PREHOOK: query: SELECT MAX(c) FROM empty
+PREHOOK: type: QUERY
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT MAX(c) FROM empty
+POSTHOOK: type: QUERY
+#### A masked pattern was here ####
+NULL
+PREHOOK: query: SELECT MAX(p) FROM empty
+PREHOOK: type: QUERY
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT MAX(p) FROM empty
+POSTHOOK: type: QUERY
+#### A masked pattern was here ####
+NULL
+PREHOOK: query: ALTER TABLE empty ADD PARTITION (p=1)
+PREHOOK: type: ALTERTABLE_ADDPARTS
+PREHOOK: Input: default@empty
+POSTHOOK: query: ALTER TABLE empty ADD PARTITION (p=1)
+POSTHOOK: type: ALTERTABLE_ADDPARTS
+POSTHOOK: Input: default@empty
+POSTHOOK: Output: default@empty@p=1
+PREHOOK: query: SELECT MAX(p) FROM empty
+PREHOOK: type: QUERY
+PREHOOK: Input: default@empty@p=1
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT MAX(p) FROM empty
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@empty@p=1
+#### A masked pattern was here ####
+1



Mime
View raw message