drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [07/16] incubator-drill git commit: DRILL-1647: Enable rewrite rule to allow multiple flattens in s a select clause. Fixes a few outstanding issues that were the reason for disabling it.
Date Wed, 12 Nov 2014 04:11:24 GMT
DRILL-1647: Enable rewrite rule to allow multiple flattens in s a select clause. Fixes a few
outstanding issues that were the reason for disabling it.

Fix for the failed Regression test run. Was an issue with removing cast information, simply
needed to return the original expression rather than try to clone it if rewriting was not
needed.

Was not visiting the child of a project appropriately, this was causing complex expressions
nested inside of a sub-query to fail.


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

Branch: refs/heads/master
Commit: 761156bf8b09a9b9cbe801bae730da340ea36d03
Parents: e515e62
Author: Jason Altekruse <altekrusejason@gmail.com>
Authored: Thu Oct 30 14:05:32 2014 -0700
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Tue Nov 11 16:48:45 2014 -0800

----------------------------------------------------------------------
 .../planner/physical/visitor/RexVisitorComplexExprSplitter.java    | 2 +-
 .../exec/planner/physical/visitor/SplitUpComplexExpressions.java   | 2 +-
 .../apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/761156bf/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/RexVisitorComplexExprSplitter.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/RexVisitorComplexExprSplitter.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/RexVisitorComplexExprSplitter.java
index 73242d5..9742a90 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/RexVisitorComplexExprSplitter.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/RexVisitorComplexExprSplitter.java
@@ -98,7 +98,7 @@ public class RexVisitorComplexExprSplitter extends RexVisitorImpl<RexNode>
{
       complexExprs.add(call.clone(new RelDataTypeDrillImpl(new RelDataTypeHolder(),factory),
newOps));
       return ret;
     }
-    return call.clone(new RelDataTypeDrillImpl(new RelDataTypeHolder(),factory), newOps);
+    return call.clone(call.getType(), newOps);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/761156bf/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/SplitUpComplexExpressions.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/SplitUpComplexExpressions.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/SplitUpComplexExpressions.java
index f53b228..0a49f3a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/SplitUpComplexExpressions.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/SplitUpComplexExpressions.java
@@ -108,7 +108,7 @@ public class SplitUpComplexExpressions extends BasePrelVisitor<Prel,
Object, Rel
     }
     List<RexNode> complexExprs = exprSplitter.getComplexExprs();
 
-    RelNode originalInput = project.getInput(0);
+    RelNode originalInput = ((Prel)project.getInput(0)).accept(this, null);
     ProjectPrel childProject;
 
     List<RexNode> allExprs = new ArrayList();

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/761156bf/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
index 5f91e6e..58c80a6 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
@@ -200,7 +200,7 @@ public class DefaultSqlHandler extends AbstractSqlHandler {
     // within a single query, it also breaks up all expressions with complex outputs into
their own project operations.
     // It currently appears to be producing good plans, but for the flatten case it is revealing
execution errors in the
     // project operator.
-//    phyRelNode = ((Prel) phyRelNode).accept(new SplitUpComplexExpressions(planner.getTypeFactory(),
context.getDrillOperatorTable(), context.getPlannerSettings().functionImplementationRegistry),
null);
+    phyRelNode = ((Prel) phyRelNode).accept(new SplitUpComplexExpressions(planner.getTypeFactory(),
context.getDrillOperatorTable(), context.getPlannerSettings().functionImplementationRegistry),
null);
     phyRelNode = ((Prel) phyRelNode).accept(new RewriteProjectToFlatten(planner.getTypeFactory(),
context.getDrillOperatorTable()), null);
     // Definitely before this one
     /*


Mime
View raw message