[fix](nereids) column prune should use slots from children (#19112)

the slots' nullable property may different between parent and children. So column prune should always use slots of children
This commit is contained in:
starocean999
2023-04-26 21:10:29 +08:00
committed by GitHub
parent aabcab9dbe
commit 55d7c5e147

View File

@ -250,7 +250,8 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
boolean hasNewChildren = false;
for (Plan child : plan.children()) {
Set<Slot> childOutputSet = child.getOutputSet();
Set<Slot> childRequiredSlots = Sets.intersection(childrenRequiredSlots, childOutputSet);
Set<Slot> childRequiredSlots = childOutputSet.stream()
.filter(childrenRequiredSlots::contains).collect(Collectors.toSet());
Plan prunedChild = doPruneChild(plan, child, childRequiredSlots);
if (prunedChild != child) {
hasNewChildren = true;