hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sze...@apache.org
Subject svn commit: r1612977 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/exec/Utilities.java test/queries/clientpositive/avro_partitioned.q test/results/clientpositive/avro_partitioned.q.out
Date Thu, 24 Jul 2014 01:18:23 GMT
Author: szehon
Date: Thu Jul 24 01:18:22 2014
New Revision: 1612977

URL: http://svn.apache.org/r1612977
Log:
HIVE-5456 : Queries fail on avro backed table with empty partition (Chaoyu Tang via Szehon)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
    hive/trunk/ql/src/test/queries/clientpositive/avro_partitioned.q
    hive/trunk/ql/src/test/results/clientpositive/avro_partitioned.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java?rev=1612977&r1=1612976&r2=1612977&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java Thu Jul 24 01:18:22
2014
@@ -3094,7 +3094,8 @@ public final class Utilities {
     PartitionDesc partDesc = work.getPathToPartitionInfo().get(strPath);
     boolean nonNative = partDesc.getTableDesc().isNonNative();
     boolean oneRow = partDesc.getInputFileFormatClass() == OneNullRowInputFormat.class;
-    Properties props = partDesc.getProperties();
+    Properties props = SerDeUtils.createOverlayedProperties(
+        partDesc.getTableDesc().getProperties(), partDesc.getProperties());
     Class<? extends HiveOutputFormat> outFileFormat = partDesc.getOutputFileFormatClass();
 
     if (nonNative) {

Modified: hive/trunk/ql/src/test/queries/clientpositive/avro_partitioned.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/avro_partitioned.q?rev=1612977&r1=1612976&r2=1612977&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/avro_partitioned.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/avro_partitioned.q Thu Jul 24 01:18:22 2014
@@ -72,7 +72,9 @@ SELECT * FROM episodes_partitioned ORDER
 SELECT * FROM episodes_partitioned WHERE doctor_pt = 6;
 -- Fetch w/non-existent partition
 SELECT * FROM episodes_partitioned WHERE doctor_pt = 7 LIMIT 5;
-
+-- Alter table add an empty partition
+ALTER TABLE episodes_partitioned ADD PARTITION (doctor_pt=7);
+SELECT COUNT(*) FROM episodes_partitioned;
 
 -- Verify that reading from an Avro partition works
 -- even if it has an old schema relative to the current table level schema

Modified: hive/trunk/ql/src/test/results/clientpositive/avro_partitioned.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/avro_partitioned.q.out?rev=1612977&r1=1612976&r2=1612977&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/avro_partitioned.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/avro_partitioned.q.out Thu Jul 24 01:18:22
2014
@@ -236,6 +236,40 @@ SELECT * FROM episodes_partitioned WHERE
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@episodes_partitioned
 #### A masked pattern was here ####
+PREHOOK: query: -- Alter table add an empty partition
+ALTER TABLE episodes_partitioned ADD PARTITION (doctor_pt=7)
+PREHOOK: type: ALTERTABLE_ADDPARTS
+PREHOOK: Output: default@episodes_partitioned
+POSTHOOK: query: -- Alter table add an empty partition
+ALTER TABLE episodes_partitioned ADD PARTITION (doctor_pt=7)
+POSTHOOK: type: ALTERTABLE_ADDPARTS
+POSTHOOK: Output: default@episodes_partitioned
+POSTHOOK: Output: default@episodes_partitioned@doctor_pt=7
+PREHOOK: query: SELECT COUNT(*) FROM episodes_partitioned
+PREHOOK: type: QUERY
+PREHOOK: Input: default@episodes_partitioned
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=1
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=11
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=2
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=4
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=5
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=6
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=7
+PREHOOK: Input: default@episodes_partitioned@doctor_pt=9
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT COUNT(*) FROM episodes_partitioned
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@episodes_partitioned
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=1
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=11
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=2
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=4
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=5
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=6
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=7
+POSTHOOK: Input: default@episodes_partitioned@doctor_pt=9
+#### A masked pattern was here ####
+8
 PREHOOK: query: -- Verify that reading from an Avro partition works
 -- even if it has an old schema relative to the current table level schema
 



Mime
View raw message