Fix bug that push down the predicates past AggregateNode (#658)

This commit is contained in:
chenhao
2019-02-26 10:55:14 +08:00
committed by ZHAO Chun
parent 4907577e99
commit 397747af2c
2 changed files with 12 additions and 10 deletions

View File

@ -143,10 +143,12 @@ ExecNode::~ExecNode() {
void ExecNode::push_down_predicate(
RuntimeState* state, std::list<ExprContext*>* expr_ctxs) {
for (int i = 0; i < _children.size(); ++i) {
_children[i]->push_down_predicate(state, expr_ctxs);
if (expr_ctxs->size() == 0) {
return;
if (_type != TPlanNodeType::AGGREGATION_NODE) {
for (int i = 0; i < _children.size(); ++i) {
_children[i]->push_down_predicate(state, expr_ctxs);
if (expr_ctxs->size() == 0) {
return;
}
}
}

View File

@ -360,13 +360,13 @@ public class DistributedPlanner {
connectChildFragment(node, 1, leftChildFragment, rightChildFragment);
leftChildFragment.setPlanRoot(node);
if (!node.getJoinOp().isOuterJoin() && !node.getJoinOp().isSemiAntiJoin()) {
// Push down the predicates constructed by the right child when the
// join op is inner join or left semi join.
if (node.getJoinOp().isInnerJoin() || node.getJoinOp().isLeftSemiJoin()) {
node.setIsPushDown(true);
}
// semi-join, only left semi join can pushDown
if (node.getJoinOp().isLeftSemiJoin()) {
node.setIsPushDown(true);
}
} else {
node.setIsPushDown(false);
}
return leftChildFragment;
} else {
node.setDistributionMode(HashJoinNode.DistributionMode.PARTITIONED);