[fix](planner)need call materializeSrcExpr for materialized slots in join node (#25204)

This commit is contained in:
starocean999
2023-10-11 16:34:53 +08:00
committed by GitHub
parent dabeeb0338
commit 2d19f2fbfe
5 changed files with 88 additions and 18 deletions

View File

@ -92,6 +92,7 @@ public class SlotDescriptor {
this.isAgg = false;
this.stats = src.stats;
this.type = src.type;
this.sourceExprs.add(new SlotRef(src));
}
public boolean isMultiRef() {

View File

@ -168,9 +168,6 @@ public abstract class JoinNodeBase extends PlanNode {
boolean needSetToNullable =
getChild(0) instanceof JoinNodeBase && analyzer.isOuterJoined(leftTupleDesc.getId());
for (SlotDescriptor leftSlotDesc : leftTupleDesc.getSlots()) {
if (!isMaterializedByChild(leftSlotDesc, getChild(0).getOutputSmap())) {
continue;
}
SlotDescriptor outputSlotDesc =
analyzer.getDescTbl().copySlotDescriptor(vOutputTupleDesc, leftSlotDesc);
if (leftNullable) {
@ -191,9 +188,6 @@ public abstract class JoinNodeBase extends PlanNode {
boolean needSetToNullable =
getChild(1) instanceof JoinNodeBase && analyzer.isOuterJoined(rightTupleDesc.getId());
for (SlotDescriptor rightSlotDesc : rightTupleDesc.getSlots()) {
if (!isMaterializedByChild(rightSlotDesc, getChild(1).getOutputSmap())) {
continue;
}
SlotDescriptor outputSlotDesc =
analyzer.getDescTbl().copySlotDescriptor(vOutputTupleDesc, rightSlotDesc);
if (rightNullable) {
@ -226,6 +220,7 @@ public abstract class JoinNodeBase extends PlanNode {
rSlotRef.getDesc().setIsMaterialized(lSlotRef.getDesc().isMaterialized());
} else {
rSlotRef.getDesc().setIsMaterialized(true);
rSlotRef.materializeSrcExpr();
}
}