From 61d54ab8624eb2d9d5f31330a07a6dfc51225ac6 Mon Sep 17 00:00:00 2001 From: 924060929 Date: Mon, 23 Dec 2024 13:12:03 +0800 Subject: [PATCH] fix --- .../plans/commands/insert/InsertIntoValuesAnalyzer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoValuesAnalyzer.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoValuesAnalyzer.java index 0ab819ac1e89ef..1c630a41c846fe 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoValuesAnalyzer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoValuesAnalyzer.java @@ -69,8 +69,16 @@ public class InsertIntoValuesAnalyzer extends AbstractBatchJobExecutor { new InlineTableToUnionOrOneRowRelation(), new BindSink(), new MergeProjects(), + + // the BatchInsertIntoTableCommand need send StringLiteral to backend, + // and only support alias(literal as xx) or alias(cast(literal as xx)), + // but not support alias(cast(slotRef as xx)) which create in BindSink, + // we should push down the cast into Union or OneRowRelation. + // the InsertIntoTableCommand support translate slotRef in the TPlan, + // so we don't need this rules, just evaluate in backend new PushProjectIntoUnion(), new PushProjectIntoOneRowRelation(), + new RewriteBatchInsertIntoExpressions(ExpressionRewrite.bottomUp( ConvertAggStateCast.INSTANCE, FoldConstantRuleOnFE.PATTERN_MATCH_INSTANCE