asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wangs...@apache.org
Subject incubator-asterixdb-hyracks git commit: ASTERIXDB-1204: fixed LIMIT pushdown into join
Date Sun, 14 Feb 2016 18:33:55 GMT
Repository: incubator-asterixdb-hyracks
Updated Branches:
  refs/heads/master a63d0f743 -> a7b3842a8


ASTERIXDB-1204: fixed LIMIT pushdown into join

 - Fixed PushMapOperatorDownThroughProductRule not to pushdown LIMIT into a JOIN operator

Change-Id: I19e73c8d444ac0c8ecfcdf3ad3ebe744d6c8d0df
Reviewed-on: https://asterix-gerrit.ics.uci.edu/632
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/commit/a7b3842a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/a7b3842a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/a7b3842a

Branch: refs/heads/master
Commit: a7b3842a8c53c39f72421d3e96ae9c975e1536c7
Parents: a63d0f7
Author: Taewoo Kim <wangsaeu@yahoo.com>
Authored: Sun Feb 14 10:04:36 2016 -0800
Committer: Taewoo Kim <wangsaeu@gmail.com>
Committed: Sun Feb 14 10:28:59 2016 -0800

----------------------------------------------------------------------
 .../rules/PushMapOperatorDownThroughProductRule.java         | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/a7b3842a/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java
b/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java
index 1c9b8d8..f956d73 100644
--- a/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java
+++ b/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.lang3.mutable.Mutable;
-
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
 import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
@@ -37,7 +36,8 @@ import org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
 public class PushMapOperatorDownThroughProductRule implements IAlgebraicRewriteRule {
 
     @Override
-    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext
context) throws AlgebricksException {
+    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext
context)
+            throws AlgebricksException {
         return false;
     }
 
@@ -45,7 +45,9 @@ public class PushMapOperatorDownThroughProductRule implements IAlgebraicRewriteR
     public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext
context)
             throws AlgebricksException {
         AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
-        if (!op1.isMap()) {
+        // Even the LIMIT operator is a map operator, we don't push LIMIT operator into a
join
+        // since a new LIMIT under a join can't generate the original result.
+        if (!op1.isMap() || op1.getOperatorTag() == LogicalOperatorTag.LIMIT) {
             return false;
         }
         Mutable<ILogicalOperator> op2Ref = op1.getInputs().get(0);


Mime
View raw message