You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/10/02 23:35:52 UTC

svn commit: r1629075 - in /hive/branches/branch-0.14/ql/src: java/org/apache/hadoop/hive/ql/optimizer/physical/ test/queries/clientpositive/ test/results/clientpositive/ test/results/clientpositive/tez/

Author: hashutosh
Date: Thu Oct  2 21:35:51 2014
New Revision: 1629075

URL: http://svn.apache.org/r1629075
Log:
HIVE-8318 : Null Scan optimizer throws exception when no partitions are selected (Ashutosh Chauhan via Gunther Hagleitner)

Modified:
    hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
    hive/branches/branch-0.14/ql/src/test/queries/clientpositive/optimize_nullscan.q
    hive/branches/branch-0.14/ql/src/test/results/clientpositive/optimize_nullscan.q.out
    hive/branches/branch-0.14/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java?rev=1629075&r1=1629074&r2=1629075&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java (original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java Thu Oct  2 21:35:51 2014
@@ -102,13 +102,19 @@ public class NullScanTaskDispatcher impl
   }
 
   private void processAlias(MapWork work, String alias) {
+    List<String> paths = getPathsForAlias(work, alias);
+    if (paths.isEmpty()) {
+      // partitioned table which don't select any partitions
+      // there are no paths to replace with fakePath
+      return;
+    }
     work.setUseOneNullRowInputFormat(true);
 
     // Change the alias partition desc
     PartitionDesc aliasPartn = work.getAliasToPartnInfo().get(alias);
     changePartitionToMetadataOnly(aliasPartn);
 
-    List<String> paths = getPathsForAlias(work, alias);
+
     for (String path : paths) {
       PartitionDesc partDesc = work.getPathToPartitionInfo().get(path);
       PartitionDesc newPartition = changePartitionToMetadataOnly(partDesc);

Modified: hive/branches/branch-0.14/ql/src/test/queries/clientpositive/optimize_nullscan.q
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/test/queries/clientpositive/optimize_nullscan.q?rev=1629075&r1=1629074&r2=1629075&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/test/queries/clientpositive/optimize_nullscan.q (original)
+++ hive/branches/branch-0.14/ql/src/test/queries/clientpositive/optimize_nullscan.q Thu Oct  2 21:35:51 2014
@@ -5,6 +5,10 @@ select key from src where false;
 select key from src where false;
 
 explain extended
+select count(key) from srcpart where 1=2 group by key;
+select count(key) from srcpart where 1=2 group by key;
+
+explain extended
 select * from (select key from src where false) a left outer join (select key from srcpart limit 0) b on a.key=b.key;
 select * from (select key from src where false) a left outer join (select key from srcpart limit 0) b on a.key=b.key;
 

Modified: hive/branches/branch-0.14/ql/src/test/results/clientpositive/optimize_nullscan.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/test/results/clientpositive/optimize_nullscan.q.out?rev=1629075&r1=1629074&r2=1629075&view=diff
==============================================================================
Files hive/branches/branch-0.14/ql/src/test/results/clientpositive/optimize_nullscan.q.out (original) and hive/branches/branch-0.14/ql/src/test/results/clientpositive/optimize_nullscan.q.out Thu Oct  2 21:35:51 2014 differ

Modified: hive/branches/branch-0.14/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out?rev=1629075&r1=1629074&r2=1629075&view=diff
==============================================================================
Files hive/branches/branch-0.14/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out (original) and hive/branches/branch-0.14/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out Thu Oct  2 21:35:51 2014 differ