Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> git commit: Fix Drill-487. Setup mappings appropriately for compare functions. Throw exception instead of assert when no join conditions are present. Enable PushFilterPastJoinRule .


Copy link to this message
-
git commit: Fix Drill-487. Setup mappings appropriately for compare functions. Throw exception instead of assert when no join conditions are present. Enable PushFilterPastJoinRule .
Repository: incubator-drill
Updated Branches:
  refs/heads/master 84d23350c -> 838fda824
Fix Drill-487. Setup mappings appropriately for compare functions. Throw exception instead of assert when no join conditions are present. Enable PushFilterPastJoinRule .
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/838fda82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/838fda82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/838fda82

Branch: refs/heads/master
Commit: 838fda82428d108547e1dd4f5ef6b3e48e6b9738
Parents: 84d2335
Author: Aman Sinha <[EMAIL PROTECTED]>
Authored: Fri Apr 4 19:02:48 2014 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Fri Apr 4 19:26:24 2014 -0700

 .../drill/exec/physical/impl/join/MergeJoinBatch.java  | 13 +++++++++----
 .../drill/exec/planner/logical/DrillRuleSets.java      |  2 +-
 2 files changed, 10 insertions(+), 5 deletions(-)
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/838fda82/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
index 0a287b6..db5bccf 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
@@ -102,8 +102,10 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
  
   protected MergeJoinBatch(MergeJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) {
     super(popConfig, context);
-    // currently only one join condition is supported
-    assert popConfig.getConditions().size() >= 1 : String.format("Merge Join currently does not support cartisian join.  This join operator was configured with %d condition(s).", popConfig.getConditions().size());
+
+    if (popConfig.getConditions().size() == 0) {
+      throw new UnsupportedOperationException("Merge Join currently does not support cartesian join.  This join operator was configured with 0 conditions");
+    }
     this.left = left;
     this.right = right;
     this.status = new JoinStatus(left, right, this);
@@ -204,6 +206,9 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
   private void generateDoCompareNextLeft(ClassGenerator<JoinWorker> cg, JVar incomingRecordBatch,
       JVar incomingLeftRecordBatch, JVar joinStatus, ErrorCollector collector) throws ClassTransformationException {
     boolean nextLeftIndexDeclared = false;
+
+    cg.setMappingSet(compareLeftMapping);
+    
     for (JoinCondition condition : conditions) {
       final LogicalExpression leftFieldExpr = condition.getLeft();
 
@@ -261,7 +266,6 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
    
     //Pass the equality check for all the join conditions. Finally, return 0.
     cg.getEvalBlock()._return(JExpr.lit(0));
-    
   }  
  
   private JoinWorker generateNewWorker() throws ClassTransformationException, IOException, SchemaChangeException{
@@ -376,6 +380,8 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
   private void generateDoCompare(ClassGenerator<JoinWorker> cg, JVar incomingRecordBatch,
       JVar incomingLeftRecordBatch, JVar incomingRightRecordBatch, ErrorCollector collector) throws ClassTransformationException {
    
+    cg.setMappingSet(compareMapping);
+    
     for (JoinCondition condition : conditions) {
       final LogicalExpression leftFieldExpr = condition.getLeft();
       final LogicalExpression rightFieldExpr = condition.getRight();
@@ -440,5 +446,4 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
     //Pass the equality check for all the join conditions. Finally, return 0.    
     cg.getEvalBlock()._return(JExpr.lit(0));  
   }
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/838fda82/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
index 53da67f..b2757a3 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
@@ -56,7 +56,7 @@ public class DrillRuleSets {
 //      TableAccessRule.instance, //
 //      MergeProjectRule.instance, //
 //      PushFilterPastProjectRule.instance, //
-//      PushFilterPastJoinRule.FILTER_ON_JOIN, //
+        PushFilterPastJoinRule.FILTER_ON_JOIN, //
 //      RemoveDistinctAggregateRule.instance, //
 //      ReduceAggregatesRule.instance, //
 //      SwapJoinRule.instance, //