diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java index c17f215e75..213ec4df3c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java @@ -155,12 +155,12 @@ public class InsertIntoTableCommand extends Command implements ForwardWithSync, physicalOlapTableSink.getDatabase(), physicalOlapTableSink.getTargetTable(), label, planner); insertExecutor.beginTransaction(); + insertExecutor.finalizeSink(sink, physicalOlapTableSink.isPartialUpdate(), + physicalOlapTableSink.isFromNativeInsertStmt()); } finally { targetTableIf.readUnlock(); } - insertExecutor.finalizeSink(sink, physicalOlapTableSink.isPartialUpdate(), - physicalOlapTableSink.isFromNativeInsertStmt()); executor.setProfileType(ProfileType.LOAD); // We exposed @StmtExecutor#cancel as a unified entry point for statement interruption // so we need to set this here