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 ba52f09d38b5cf..1f3752e74bb21d 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 @@ -345,12 +345,13 @@ private BuildInsertExecutorResult initPlanOnce(ConnectContext ctx, } OlapGroupCommitInsertExecutor.analyzeGroupCommit( ctx, targetTableIf, this.logicalQuery.get(), this.insertCtx); + + LogicalPlanAdapter logicalPlanAdapter + = new LogicalPlanAdapter(logicalQuery.get(), ctx.getStatementContext()); + return planInsertExecutor(ctx, stmtExecutor, logicalPlanAdapter, targetTableIf); } finally { targetTableIf.readUnlock(); } - - LogicalPlanAdapter logicalPlanAdapter = new LogicalPlanAdapter(logicalQuery.get(), ctx.getStatementContext()); - return planInsertExecutor(ctx, stmtExecutor, logicalPlanAdapter, targetTableIf); } // we should select the factory type first, but we can not initial InsertExecutor at this time,