drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-5159: Drill's ProjectMergeRule should operate on RelNodes with same convention trait.
Date Wed, 04 Jan 2017 21:43:51 GMT
Repository: drill
Updated Branches:
  refs/heads/master bbcf4b765 -> d375eeb45


DRILL-5159: Drill's ProjectMergeRule should operate on RelNodes with same convention trait.

close apache/drill#705


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/d375eeb4
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/d375eeb4
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/d375eeb4

Branch: refs/heads/master
Commit: d375eeb458d21cec246d486b88ddd26ab4b28ada
Parents: bbcf4b7
Author: Jinfeng Ni <jni@apache.org>
Authored: Wed Dec 21 18:00:46 2016 -0800
Committer: Jinfeng Ni <jni@apache.org>
Committed: Wed Jan 4 13:41:17 2017 -0800

----------------------------------------------------------------------
 .../drill/exec/planner/logical/DrillMergeProjectRule.java    | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/d375eeb4/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
index b049277..6c69e28 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
@@ -18,6 +18,8 @@
 package org.apache.drill.exec.planner.logical;
 
 
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.ConventionTraitDef;
 import org.apache.calcite.plan.RelOptRuleCall;
 import org.apache.calcite.rel.core.Project;
 import org.apache.calcite.rel.rules.ProjectMergeRule;
@@ -48,6 +50,12 @@ public class DrillMergeProjectRule extends ProjectMergeRule {
     Project topProject = call.rel(0);
     Project bottomProject = call.rel(1);
 
+    // Make sure both projects be LogicalProject.
+    if (topProject.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) != Convention.NONE
||
+        bottomProject.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) != Convention.NONE)
{
+      return false;
+    }
+
     // We have a complex output type do not fire the merge project rule
     if (checkComplexOutput(topProject) || checkComplexOutput(bottomProject)) {
       return false;


Mime
View raw message