hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1633712 - /hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
Date Wed, 22 Oct 2014 20:29:23 GMT
Author: hashutosh
Date: Wed Oct 22 20:29:23 2014
New Revision: 1633712

URL: http://svn.apache.org/r1633712
Log:
HIVE-8558 : CBO: enable n-way joins after CBO join reordering (Harish Butani via Ashutosh
Chauhan)

Modified:
    hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=1633712&r1=1633711&r2=1633712&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
(original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
Wed Oct 22 20:29:23 2014
@@ -8263,7 +8263,8 @@ public class SemanticAnalyzer extends Ba
         continue;
       }
       JoinType prevType = null;   // save join type
-      for (int j = i - 1; j >= 0; j--) {
+      boolean continueScanning = true;
+      for (int j = i - 1; j >= 0 && continueScanning; j--) {
         QBJoinTree node = trees.get(j);
         if (node == null) {
           continue;
@@ -8279,6 +8280,7 @@ public class SemanticAnalyzer extends Ba
           if (!node.getNoOuterJoin() || !target.getNoOuterJoin()) {
             if (node.getRightAliases().length + target.getRightAliases().length + 1 >
16) {
               LOG.info(ErrorMsg.JOINNODE_OUTERJOIN_MORETHAN_16);
+              continueScanning = !runCBO;
               continue;
             }
           }
@@ -8286,6 +8288,11 @@ public class SemanticAnalyzer extends Ba
           trees.set(j, null);
           continue; // continue merging with next alias
         }
+        /*
+         * for CBO provided orderings, don't attempt to reorder joins.
+         * only convert consecutive joins into n-way joins.
+         */
+        continueScanning = !runCBO;
         if (prevType == null) {
           prevType = currType;
         }
@@ -9937,7 +9944,7 @@ public class SemanticAnalyzer extends Ba
         //prunedPartitions = ImmutableMap.copyOf(prunedPartitions);
         getMetaData(qb);
 
-        disableJoinMerge = true;
+        disableJoinMerge = false;
         sinkOp = genPlan(qb);
         LOG.info("CBO Succeeded; optimized logical plan.");
         LOG.debug(newAST.dump());



Mime
View raw message