[fix](nereids)scan node's smap should use materiazlied slots and project list as left and right expr list (#21142)

This commit is contained in:
starocean999
2023-06-25 22:34:43 +08:00
committed by GitHub
parent 8f7a62c79b
commit 58b3e5ebdb
2 changed files with 66 additions and 2 deletions

View File

@ -533,8 +533,11 @@ public abstract class ScanNode extends PlanNode {
// this happens if the olap table is in the most inner sub-query block in the cascades sub-queries
// create a tmpSmap for the later setOutputSmap call
ExprSubstitutionMap tmpSmap = new ExprSubstitutionMap(
Lists.newArrayList(outputTupleDesc.getSlots().stream().map(slot -> new SlotRef(slot)).collect(
Collectors.toList())), Lists.newArrayList(projectList));
Lists.newArrayList(outputTupleDesc.getSlots().stream()
.filter(slot -> slot.isMaterialized())
.map(slot -> new SlotRef(slot))
.collect(Collectors.toList())),
Lists.newArrayList(projectList));
Set<SlotId> allOutputSlotIds = outputTupleDesc.getSlots().stream().map(slot -> slot.getId())
.collect(Collectors.toSet());
List<Expr> newRhs = Lists.newArrayList();