This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 61ad3b8dc4c [fix](nereids)LogicalCTEConsumer's output lost column info 
in SlotReference (#28452)
61ad3b8dc4c is described below

commit 61ad3b8dc4c77031d2c7843a4e2bafaa5c3eb45f
Author: starocean999 <[email protected]>
AuthorDate: Sat Dec 16 23:35:09 2023 +0800

    [fix](nereids)LogicalCTEConsumer's output lost column info in SlotReference 
(#28452)
---
 .../doris/nereids/trees/plans/logical/LogicalCTEConsumer.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCTEConsumer.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCTEConsumer.java
index 97ea18600c3..9c0996a2c3c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCTEConsumer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCTEConsumer.java
@@ -22,6 +22,7 @@ import org.apache.doris.nereids.properties.LogicalProperties;
 import org.apache.doris.nereids.trees.expressions.CTEId;
 import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.StatementScopeIdGenerator;
 import org.apache.doris.nereids.trees.plans.BlockFuncDepsPropagation;
 import org.apache.doris.nereids.trees.plans.Plan;
 import org.apache.doris.nereids.trees.plans.PlanType;
@@ -93,8 +94,13 @@ public class LogicalCTEConsumer extends LogicalRelation 
implements BlockFuncDeps
     private void initOutputMaps(LogicalPlan childPlan) {
         List<Slot> producerOutput = childPlan.getOutput();
         for (Slot producerOutputSlot : producerOutput) {
-            Slot consumerSlot = new SlotReference(producerOutputSlot.getName(),
-                    producerOutputSlot.getDataType(), 
producerOutputSlot.nullable(), ImmutableList.of(name));
+            SlotReference slotRef =
+                    producerOutputSlot instanceof SlotReference ? 
(SlotReference) producerOutputSlot : null;
+            Slot consumerSlot = new 
SlotReference(StatementScopeIdGenerator.newExprId(),
+                    producerOutputSlot.getName(), 
producerOutputSlot.getDataType(),
+                    producerOutputSlot.nullable(), ImmutableList.of(name),
+                    slotRef != null ? (slotRef.getColumn().isPresent() ? 
slotRef.getColumn().get() : null) : null,
+                    slotRef != null ? Optional.of(slotRef.getInternalName()) : 
Optional.empty());
             producerToConsumerOutputMap.put(producerOutputSlot, consumerSlot);
             consumerToProducerOutputMap.put(consumerSlot, producerOutputSlot);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to