[fix](Nereids) Should copy JoinReorderContext for PushdownProject (#19508)
1. should copy JoinReorderContext 2. verify bushy tree join reorder
This commit is contained in:
@ -101,7 +101,7 @@ public class JoinExchangeRightProject extends OneExplorationRuleFactory {
|
||||
newTopJoinHashJoinConjuncts, newTopJoinOtherJoinConjuncts, JoinHint.NONE,
|
||||
left, right);
|
||||
JoinExchange.setNewLeftJoinReorder(newLeftJoin, leftJoin);
|
||||
JoinExchange.setNewRightJoinReorder(newRightJoin, leftJoin);
|
||||
JoinExchange.setNewRightJoinReorder(newRightJoin, rightJoin);
|
||||
JoinExchange.setNewTopJoinReorder(newTopJoin, topJoin);
|
||||
|
||||
return CBOUtils.projectOrSelf(new ArrayList<>(topJoin.getOutput()), newTopJoin);
|
||||
|
||||
@ -121,7 +121,7 @@ public class PushdownProjectThroughInnerJoin implements ExplorationRuleFactory {
|
||||
Plan newLeft = CBOUtils.projectOrSelf(newAProject.build(), join.left());
|
||||
|
||||
if (!rightContains) {
|
||||
Plan newJoin = join.withChildrenNoContext(newLeft, join.right());
|
||||
Plan newJoin = join.withChildren(newLeft, join.right());
|
||||
return CBOUtils.projectOrSelf(new ArrayList<>(project.getOutput()), newJoin);
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ public class PushdownProjectThroughInnerJoin implements ExplorationRuleFactory {
|
||||
bConditionSlots.stream().filter(slot -> !bProjectSlots.contains(slot)).forEach(newBProject::add);
|
||||
Plan newRight = CBOUtils.projectOrSelf(newBProject.build(), join.right());
|
||||
|
||||
Plan newJoin = join.withChildrenNoContext(newLeft, newRight);
|
||||
Plan newJoin = join.withChildren(newLeft, newRight);
|
||||
return CBOUtils.projectOrSelf(new ArrayList<>(project.getOutput()), newJoin);
|
||||
}
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ public class PushdownProjectThroughSemiJoin implements ExplorationRuleFactory {
|
||||
.forEach(newProject::add);
|
||||
Plan newLeft = CBOUtils.projectOrSelf(newProject, join.left());
|
||||
|
||||
Plan newJoin = join.withChildrenNoContext(newLeft, join.right());
|
||||
Plan newJoin = join.withChildren(newLeft, join.right());
|
||||
return CBOUtils.projectOrSelf(new ArrayList<>(project.getOutput()), newJoin);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user