From 9e9dfe1c0171457354fc2503a924dbd0025e165a Mon Sep 17 00:00:00 2001 From: 924060929 Date: Wed, 27 Nov 2024 16:28:51 +0800 Subject: [PATCH] fix --- .../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 9bc083f9f8a49f6..43e569d437dffc1 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.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 Plan visitUnboundTableSink( public Plan visitLogicalInlineTable(LogicalInlineTable logicalInlineTable, Void context) { logicalInlineTable = (LogicalInlineTable) super.visitLogicalInlineTable(logicalInlineTable, context); + + List 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); } };