hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gop...@apache.org
Subject [79/82] [abbrv] hive git commit: HIVE-10804 : CBO: Calcite Operator To Hive Operator (Calcite Return Path): optimizer for limit 0 does not work (Pengcheng Xiong via Ashutosh Chauhan)
Date Fri, 29 May 2015 00:51:26 GMT
HIVE-10804 : CBO: Calcite Operator To Hive Operator (Calcite Return Path): optimizer for limit
0 does not work (Pengcheng Xiong via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


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

Branch: refs/heads/llap
Commit: 7add1a887bc7b896de9c7bc2f32f6395a735739a
Parents: db09c93
Author: Pengcheng Xiong <pxiong@hortonworks.com>
Authored: Tue May 26 16:31:00 2015 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Thu May 28 13:53:08 2015 -0700

----------------------------------------------------------------------
 .../hive/ql/optimizer/calcite/translator/HiveOpConverter.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/7add1a88/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
index efc2542..4f19caf 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
@@ -451,7 +451,11 @@ public class HiveOpConverter {
     if (sortRel.fetch != null) {
       int limit = RexLiteral.intValue(sortRel.fetch);
       LimitDesc limitDesc = new LimitDesc(limit);
-      // TODO: Set 'last limit' global property
+      // Because we are visiting the operators recursively, the last limit op that
+      // calls the following function will set the global property.
+      if (this.semanticAnalyzer != null && semanticAnalyzer.getQB() != null
+          && semanticAnalyzer.getQB().getParseInfo() != null)
+        this.semanticAnalyzer.getQB().getParseInfo().setOuterQueryLimit(limit);
       ArrayList<ColumnInfo> cinfoLst = createColInfos(inputOp);
       resultOp = OperatorFactory.getAndMakeChild(limitDesc,
           new RowSchema(cinfoLst), resultOp);


Mime
View raw message