Taewoo Kim has submitted this change and it was merged. Change subject: ASTERIXDB-1204: fixed LIMIT pushdown into join ......................................................................
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 <[email protected]> Reviewed-by: Yingyi Bu <[email protected]> --- M algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/PushMapOperatorDownThroughProductRule.java 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Yingyi Bu: Looks good to me, approved Jenkins: Verified 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.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 @@ 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 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); -- To view, visit https://asterix-gerrit.ics.uci.edu/632 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19e73c8d444ac0c8ecfcdf3ad3ebe744d6c8d0df Gerrit-PatchSet: 4 Gerrit-Project: hyracks Gerrit-Branch: master Gerrit-Owner: Taewoo Kim <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Taewoo Kim <[email protected]> Gerrit-Reviewer: Yingyi Bu <[email protected]>
