Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (unknown [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C54218F1C for ; Fri, 29 May 2015 00:51:59 +0000 (UTC) Received: (qmail 65862 invoked by uid 500); 29 May 2015 00:50:50 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 65783 invoked by uid 500); 29 May 2015 00:50:50 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 64616 invoked by uid 99); 29 May 2015 00:50:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 00:50:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BA8E8E17BF; Fri, 29 May 2015 00:50:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gopalv@apache.org To: commits@hive.apache.org Date: Fri, 29 May 2015 00:51:01 -0000 Message-Id: In-Reply-To: <3dcd58e1b7cf4f959c0455624f1746b6@git.apache.org> References: <3dcd58e1b7cf4f959c0455624f1746b6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [54/82] [abbrv] hive git commit: HIVE-10800 : CBO (Calcite Return Path): Setup correct information if CBO succeeds (Jesus Camacho Rodriguez via Ashutosh Chauhan) HIVE-10800 : CBO (Calcite Return Path): Setup correct information if CBO succeeds (Jesus Camacho Rodriguez via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/c577e60d Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c577e60d Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c577e60d Branch: refs/heads/llap Commit: c577e60d0343288bff599a80592417ba63228637 Parents: c75167d Author: Jesus Camacho Rodriguez Authored: Fri May 22 07:39:00 2015 -0700 Committer: Ashutosh Chauhan Committed: Mon May 25 23:19:26 2015 -0700 ---------------------------------------------------------------------- .../hadoop/hive/ql/parse/CalcitePlanner.java | 33 +++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/c577e60d/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java index 4760a22..4b111e8 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java @@ -240,6 +240,9 @@ public class CalcitePlanner extends SemanticAnalyzer { try { if (this.conf.getBoolVar(HiveConf.ConfVars.HIVE_CBO_RETPATH_HIVEOP)) { sinkOp = getOptimizedHiveOPDag(); + LOG.info("CBO Succeeded; optimized logical plan."); + this.ctx.setCboInfo("Plan optimized by CBO."); + this.ctx.setCboSucceeded(true); } else { // 1. Gen Optimized AST ASTNode newAST = getOptimizedAST(); @@ -254,21 +257,21 @@ public class CalcitePlanner extends SemanticAnalyzer { setAST(newAST); newAST = reAnalyzeCtasAfterCbo(newAST); } - Phase1Ctx ctx_1 = initPhase1Ctx(); - if (!doPhase1(newAST, getQB(), ctx_1, null)) { - throw new RuntimeException("Couldn't do phase1 on CBO optimized query plan"); - } - // unfortunately making prunedPartitions immutable is not possible - // here with SemiJoins not all tables are costed in CBO, so their - // PartitionList is not evaluated until the run phase. - getMetaData(getQB()); - - disableJoinMerge = false; - sinkOp = genPlan(getQB()); - LOG.info("CBO Succeeded; optimized logical plan."); - this.ctx.setCboInfo("Plan optimized by CBO."); - this.ctx.setCboSucceeded(true); - LOG.debug(newAST.dump()); + Phase1Ctx ctx_1 = initPhase1Ctx(); + if (!doPhase1(newAST, getQB(), ctx_1, null)) { + throw new RuntimeException("Couldn't do phase1 on CBO optimized query plan"); + } + // unfortunately making prunedPartitions immutable is not possible + // here with SemiJoins not all tables are costed in CBO, so their + // PartitionList is not evaluated until the run phase. + getMetaData(getQB()); + + disableJoinMerge = false; + sinkOp = genPlan(getQB()); + LOG.info("CBO Succeeded; optimized logical plan."); + this.ctx.setCboInfo("Plan optimized by CBO."); + this.ctx.setCboSucceeded(true); + LOG.debug(newAST.dump()); } } catch (Exception e) { boolean isMissingStats = noColsMissingStats.get() > 0;