[fix](planner) should not push down sink when last exchange do limit (#31622)

This commit is contained in:
morrySnow
2024-03-01 14:15:56 +08:00
committed by yiguolei
parent 7d1db6cd1f
commit a8e2652f78
2 changed files with 3 additions and 6 deletions

View File

@ -105,11 +105,8 @@ public class ExchangeNode extends PlanNode {
computeTupleIds();
}
public boolean isMergingExchange() {
if (mergeInfo != null) {
return true;
}
return false;
public boolean isFunctionalExchange() {
return mergeInfo != null || limit != -1 || offset != 0;
}
@Override

View File

@ -373,7 +373,7 @@ public class OriginalPlanner extends Planner {
PlanFragment topPlanFragment = fragments.get(0);
ExchangeNode topPlanNode = (ExchangeNode) topPlanFragment.getPlanRoot();
// try to push down result file sink
if (topPlanNode.isMergingExchange()) {
if (topPlanNode.isFunctionalExchange()) {
return;
}
PlanFragment secondPlanFragment = fragments.get(1);