[fix](Nereids) filter-limit-project translate to wrong plan (#32496)
This commit is contained in:
@ -1170,7 +1170,14 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla
|
||||
}
|
||||
|
||||
PlanNode planNode = inputFragment.getPlanRoot();
|
||||
if (planNode instanceof ExchangeNode || planNode instanceof SortNode || planNode instanceof UnionNode) {
|
||||
Plan child = filter.child();
|
||||
while (child instanceof PhysicalLimit) {
|
||||
child = ((PhysicalLimit<?>) child).child();
|
||||
}
|
||||
if (planNode instanceof ExchangeNode || planNode instanceof SortNode || planNode instanceof UnionNode
|
||||
// this means we have filter->limit->project, need a SelectNode
|
||||
|| (child instanceof PhysicalProject
|
||||
&& !((PhysicalProject<?>) child).hasPushedDownToProjectionFunctions())) {
|
||||
// the three nodes don't support conjuncts, need create a SelectNode to filter data
|
||||
SelectNode selectNode = new SelectNode(context.nextPlanNodeId(), planNode);
|
||||
selectNode.setNereidsId(filter.getId());
|
||||
|
||||
Reference in New Issue
Block a user