Return-Path: X-Original-To: apmail-incubator-drill-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-drill-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CB2F17C86 for ; Wed, 12 Nov 2014 04:11:19 +0000 (UTC) Received: (qmail 99919 invoked by uid 500); 12 Nov 2014 04:11:19 -0000 Delivered-To: apmail-incubator-drill-commits-archive@incubator.apache.org Received: (qmail 99842 invoked by uid 500); 12 Nov 2014 04:11:19 -0000 Mailing-List: contact drill-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: drill-commits@incubator.apache.org Delivered-To: mailing list drill-commits@incubator.apache.org Received: (qmail 99810 invoked by uid 99); 12 Nov 2014 04:11:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 04:11:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 758D8A0F1A3; Wed, 12 Nov 2014 04:11:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jacques@apache.org To: drill-commits@incubator.apache.org Date: Wed, 12 Nov 2014 04:11:24 -0000 Message-Id: <3dd83bc52abe42ef8413ff548a1d40d0@git.apache.org> In-Reply-To: <18cba4a1b9fa4c32b36b75130cb6c4bc@git.apache.org> References: <18cba4a1b9fa4c32b36b75130cb6c4bc@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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. 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 Authored: Thu Oct 30 14:05:32 2014 -0700 Committer: Jacques Nadeau 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 { 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 complexExprs = exprSplitter.getComplexExprs(); - RelNode originalInput = project.getInput(0); + RelNode originalInput = ((Prel)project.getInput(0)).accept(this, null); ProjectPrel childProject; List 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 /*