hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1233127 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java test/queries/clientpositive/union27.q test/results/clientpositive/union27.q.out
Date Wed, 18 Jan 2012 23:49:03 GMT
Author: namit
Date: Wed Jan 18 23:49:03 2012
New Revision: 1233127

URL: http://svn.apache.org/viewvc?rev=1233127&view=rev
Log:
HIVE-2718 NPE in union followed by join
(He Yongqiang via namit)


Added:
    hive/trunk/ql/src/test/queries/clientpositive/union27.q
    hive/trunk/ql/src/test/results/clientpositive/union27.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java?rev=1233127&r1=1233126&r2=1233127&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java Wed Jan
18 23:49:03 2012
@@ -388,6 +388,13 @@ public final class GenMapRedUtils {
     setUnionPlan(opProcCtx, local, plan, uCtx, true);
 
     List<Task<? extends Serializable>> parTasks = null;
+    if (opProcCtx.getRootTasks().contains(currentUnionTask)) {
+      opProcCtx.getRootTasks().remove(currentUnionTask);
+      if (!opProcCtx.getRootTasks().contains(existingTask)) {
+        opProcCtx.getRootTasks().add(existingTask);
+      }
+    }
+
     if ((currentUnionTask != null) && (currentUnionTask.getParentTasks() != null)
         && !currentUnionTask.getParentTasks().isEmpty()) {
       parTasks = new ArrayList<Task<? extends Serializable>>();

Added: hive/trunk/ql/src/test/queries/clientpositive/union27.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/union27.q?rev=1233127&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/union27.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/union27.q Wed Jan 18 23:49:03 2012
@@ -0,0 +1,4 @@
+create table jackson_sev_same as select * from src;
+create table dim_pho as select * from src;
+create table jackson_sev_add as select * from src;
+select b.* from jackson_sev_same a join (select * from dim_pho union all select * from jackson_sev_add)b
on a.key=b.key and b.key=97;

Added: hive/trunk/ql/src/test/results/clientpositive/union27.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union27.q.out?rev=1233127&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union27.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/union27.q.out Wed Jan 18 23:49:03 2012
@@ -0,0 +1,41 @@
+PREHOOK: query: create table jackson_sev_same as select * from src
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+POSTHOOK: query: create table jackson_sev_same as select * from src
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@jackson_sev_same
+PREHOOK: query: create table dim_pho as select * from src
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+POSTHOOK: query: create table dim_pho as select * from src
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@dim_pho
+PREHOOK: query: create table jackson_sev_add as select * from src
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+POSTHOOK: query: create table jackson_sev_add as select * from src
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@jackson_sev_add
+PREHOOK: query: select b.* from jackson_sev_same a join (select * from dim_pho union all
select * from jackson_sev_add)b on a.key=b.key and b.key=97
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dim_pho
+PREHOOK: Input: default@jackson_sev_add
+PREHOOK: Input: default@jackson_sev_same
+#### A masked pattern was here ####
+POSTHOOK: query: select b.* from jackson_sev_same a join (select * from dim_pho union all
select * from jackson_sev_add)b on a.key=b.key and b.key=97
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dim_pho
+POSTHOOK: Input: default@jackson_sev_add
+POSTHOOK: Input: default@jackson_sev_same
+#### A masked pattern was here ####
+97	val_97
+97	val_97
+97	val_97
+97	val_97
+97	val_97
+97	val_97
+97	val_97
+97	val_97



Mime
View raw message