This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push: new 8913e3924c [Fix](planner)Fix TupleDescriptor include not materialized slot bug (#18783) 8913e3924c is described below commit 8913e3924c0b9173fb0c1892bba8bb97d322c202 Author: Jibing-Li <64681310+jibing...@users.noreply.github.com> AuthorDate: Wed Apr 19 14:08:09 2023 +0800 [Fix](planner)Fix TupleDescriptor include not materialized slot bug (#18783) setOutputSmap function in ScanNode may include not materialized to outputTupleDesc. This PR is to fix this. --- .../src/main/java/org/apache/doris/planner/ScanNode.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java index 5862667a06..9cf58588bb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java @@ -497,7 +497,7 @@ public abstract class ScanNode extends PlanNode { // 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)); + Collectors.toList())), Lists.newArrayList(projectList)); Set<SlotId> allOutputSlotIds = outputTupleDesc.getSlots().stream().map(slot -> slot.getId()) .collect(Collectors.toSet()); List<Expr> newRhs = Lists.newArrayList(); @@ -511,10 +511,14 @@ public abstract class ScanNode extends PlanNode { slotDesc.initFromExpr(rhsExpr); if (rhsExpr instanceof SlotRef) { slotDesc.setSrcColumn(((SlotRef) rhsExpr).getColumn()); + slotDesc.setIsMaterialized(((SlotRef) rhsExpr).getDesc().isMaterialized()); + } else { + slotDesc.setIsMaterialized(true); + } + if (slotDesc.isMaterialized()) { + slotDesc.materializeSrcExpr(); + projectList.add(rhsExpr); } - slotDesc.setIsMaterialized(true); - slotDesc.materializeSrcExpr(); - projectList.add(rhsExpr); newRhs.add(new SlotRef(slotDesc)); allOutputSlotIds.add(slotDesc.getId()); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org