Fix bug that push down the predicates past AggregateNode (#658)
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user