You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2014/12/30 03:34:59 UTC

svn commit: r1648469 - in /hive/branches/spark: ./ hbase-handler/ itests/src/test/resources/ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ ql/src/test/queries/clientpositive/ ql/src/test/results/clientpositive/ ql/src/test/results/clientpositive/tez/

Author: xuefu
Date: Tue Dec 30 02:34:58 2014
New Revision: 1648469

URL: http://svn.apache.org/r1648469
Log:
HIVE-9215 : Some mapjoin queries broken with IdentityProjectRemover with PPD (Navis reviewed by Xuefu Zhang and Szehon Ho)
merged from trunk, r1648457

Added:
    hive/branches/spark/ql/src/test/queries/clientpositive/identity_project_remove_skip.q
      - copied unchanged from r1648457, hive/trunk/ql/src/test/queries/clientpositive/identity_project_remove_skip.q
    hive/branches/spark/ql/src/test/results/clientpositive/identity_project_remove_skip.q.out
      - copied unchanged from r1648457, hive/trunk/ql/src/test/results/clientpositive/identity_project_remove_skip.q.out
    hive/branches/spark/ql/src/test/results/clientpositive/tez/identity_project_remove_skip.q.out
      - copied unchanged from r1648457, hive/trunk/ql/src/test/results/clientpositive/tez/identity_project_remove_skip.q.out
Modified:
    hive/branches/spark/   (props changed)
    hive/branches/spark/hbase-handler/pom.xml   (props changed)
    hive/branches/spark/itests/src/test/resources/testconfiguration.properties
    hive/branches/spark/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IdentityProjectRemover.java
    hive/branches/spark/ql/src/test/results/clientpositive/ppd_join4.q.out

Propchange: hive/branches/spark/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 30 02:34:58 2014
@@ -2,4 +2,4 @@
 /hive/branches/cbo:1605012-1627125
 /hive/branches/tez:1494760-1622766
 /hive/branches/vectorization:1466908-1527856
-/hive/trunk:1608589-1648226,1648397
+/hive/trunk:1608589-1648226,1648397,1648457

Propchange: hive/branches/spark/hbase-handler/pom.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 30 02:34:58 2014
@@ -2,4 +2,4 @@
 /hive/branches/cbo/hbase-handler/pom.xml:1605012-1627125
 /hive/branches/tez/hbase-handler/pom.xml:1494760-1622766
 /hive/branches/vectorization/hbase-handler/pom.xml:1466908-1527856
-/hive/trunk/hbase-handler/pom.xml:1494760-1537575,1608589-1633422,1633911,1634262,1634442,1634636,1634946,1636885,1636888,1637521,1641875,1642127,1642148,1643125,1644171,1644717,1644764,1644780,1646994,1648397
+/hive/trunk/hbase-handler/pom.xml:1494760-1537575,1608589-1633422,1633911,1634262,1634442,1634636,1634946,1636885,1636888,1637521,1641875,1642127,1642148,1643125,1644171,1644717,1644764,1644780,1646994,1648397,1648457

Modified: hive/branches/spark/itests/src/test/resources/testconfiguration.properties
URL: http://svn.apache.org/viewvc/hive/branches/spark/itests/src/test/resources/testconfiguration.properties?rev=1648469&r1=1648468&r2=1648469&view=diff
==============================================================================
--- hive/branches/spark/itests/src/test/resources/testconfiguration.properties (original)
+++ hive/branches/spark/itests/src/test/resources/testconfiguration.properties Tue Dec 30 02:34:58 2014
@@ -99,6 +99,7 @@ minitez.query.files.shared=alter_merge_2
   groupby2.q,\
   groupby3.q,\
   having.q,\
+  identity_project_remove_skip.q\
   insert1.q,\
   insert_into1.q,\
   insert_into2.q,\

Modified: hive/branches/spark/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IdentityProjectRemover.java
URL: http://svn.apache.org/viewvc/hive/branches/spark/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IdentityProjectRemover.java?rev=1648469&r1=1648468&r2=1648469&view=diff
==============================================================================
--- hive/branches/spark/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IdentityProjectRemover.java (original)
+++ hive/branches/spark/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IdentityProjectRemover.java Tue Dec 30 02:34:58 2014
@@ -24,10 +24,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterators;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hive.ql.exec.LateralViewForwardOperator;
 import org.apache.hadoop.hive.ql.exec.Operator;
+import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator;
 import org.apache.hadoop.hive.ql.exec.SelectOperator;
 import org.apache.hadoop.hive.ql.lib.DefaultGraphWalker;
 import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher;
@@ -91,6 +94,11 @@ public class IdentityProjectRemover impl
         return null;
       }
       Operator<? extends OperatorDesc> parent = parents.get(0);
+      if (parent instanceof ReduceSinkOperator && Iterators.any(sel.getChildOperators().iterator(),
+          Predicates.instanceOf(ReduceSinkOperator.class))) {
+        // For RS-SEL-RS case. reducer operator in reducer task cannot be null in task compiler
+        return null;
+      }
       if(sel.isIdentitySelect()) {
         parent.removeChildAndAdoptItsChildren(sel);
         LOG.debug("Identity project remover optimization removed : " + sel);

Modified: hive/branches/spark/ql/src/test/results/clientpositive/ppd_join4.q.out
URL: http://svn.apache.org/viewvc/hive/branches/spark/ql/src/test/results/clientpositive/ppd_join4.q.out?rev=1648469&r1=1648468&r2=1648469&view=diff
==============================================================================
--- hive/branches/spark/ql/src/test/results/clientpositive/ppd_join4.q.out (original)
+++ hive/branches/spark/ql/src/test/results/clientpositive/ppd_join4.q.out Tue Dec 30 02:34:58 2014
@@ -66,11 +66,14 @@ STAGE PLANS:
                   sort order: +
                   Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
       Reduce Operator Tree:
-        Reduce Output Operator
-          key expressions: 'a' (type: string)
-          sort order: +
-          Map-reduce partition columns: '' (type: string)
+        Select Operator
           Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+          File Output Operator
+            compressed: false
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
   Stage: Stage-2
     Map Reduce