[fix](planner)sort node should materialized required slots for itself (#27605)
this is a follow up pr for #27526 . The old pr didn't fix the problem correctly, this pr do.
This commit is contained in:
@ -275,9 +275,6 @@ public abstract class JoinNodeBase extends PlanNode {
|
||||
SlotId firstMaterializedSlotId = null;
|
||||
for (TupleDescriptor tupleDescriptor : outputTupleDescList) {
|
||||
for (SlotDescriptor slotDescriptor : tupleDescriptor.getSlots()) {
|
||||
if ((requiredSlotIdSet != null && requiredSlotIdSet.contains(slotDescriptor.getId()))) {
|
||||
slotDescriptor.setIsMaterialized(true);
|
||||
}
|
||||
if (slotDescriptor.isMaterialized()) {
|
||||
if ((requiredSlotIdSet == null || requiredSlotIdSet.contains(slotDescriptor.getId()))) {
|
||||
outputSlotIds.add(slotDescriptor.getId());
|
||||
|
||||
@ -269,6 +269,13 @@ public class SortNode extends PlanNode {
|
||||
Expr.getIds(info.getOrderingExprs(), null, ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initOutputSlotIds(Set<SlotId> requiredSlotIdSet, Analyzer analyzer) {
|
||||
// need call materializeRequiredSlots again to make sure required slots is materialized by children
|
||||
// requiredSlotIdSet parameter means nothing for sort node, just call materializeRequiredSlots is enough
|
||||
info.materializeRequiredSlots(analyzer, outputSmap);
|
||||
}
|
||||
|
||||
private void removeUnusedExprs() {
|
||||
if (!isUnusedExprRemoved) {
|
||||
if (resolvedTupleExprs != null) {
|
||||
|
||||
Reference in New Issue
Block a user