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

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

commit 487e786363d5247057b04477e362aba5aac69dd2
Author: 924060929 <lanhuaj...@selectdb.com>
AuthorDate: Wed Nov 27 16:28:51 2024 +0800

    fix
---
 .../trees/plans/commands/insert/InsertIntoTableCommand.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
index 9bc083f9f8a..43e569d437d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
@@ -43,7 +43,9 @@ import org.apache.doris.nereids.rules.RuleType;
 import org.apache.doris.nereids.rules.analysis.BindSink;
 import 
org.apache.doris.nereids.rules.implementation.LogicalOlapTableSinkToPhysicalOlapTableSink;
 import org.apache.doris.nereids.rules.rewrite.MergeProjects;
+import org.apache.doris.nereids.trees.expressions.NamedExpression;
 import org.apache.doris.nereids.trees.expressions.Slot;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
 import org.apache.doris.nereids.trees.plans.Explainable;
 import org.apache.doris.nereids.trees.plans.Plan;
 import org.apache.doris.nereids.trees.plans.PlanType;
@@ -496,10 +498,15 @@ public class InsertIntoTableCommand extends Command 
implements ForwardWithSync,
                 public Plan visitLogicalInlineTable(LogicalInlineTable 
logicalInlineTable, Void context) {
                     logicalInlineTable =
                             (LogicalInlineTable) 
super.visitLogicalInlineTable(logicalInlineTable, context);
+
+                    List<NamedExpression> outputs = Lists.newArrayList();
+                    for (Slot slot : logicalInlineTable.getOutput()) {
+                        outputs.add(new SlotReference(slot.getName(), 
slot.getDataType(), slot.nullable()));
+                    }
+
                     return new LogicalUnion(
-                            Qualifier.ALL, 
logicalInlineTable.getConstantExprsList().get(0),
-                            ImmutableList.of(), 
logicalInlineTable.getConstantExprsList(), false, ImmutableList.of()
-                    );
+                            Qualifier.ALL, 
logicalInlineTable.getConstantExprsList(), ImmutableList.of()
+                    ).withNewOutputs(outputs);
                 }
             };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to