diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java index 768b3aecbe..bbf09189c2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java @@ -201,7 +201,8 @@ public class DeleteStmt extends DdlStmt { cols, new InsertSource(selectStmt), null, - isPartialUpdate); + isPartialUpdate, + NativeInsertStmt.InsertType.DELETE); ((NativeInsertStmt) insertStmt).setIsFromDeleteOrUpdateStmt(true); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java index 1fd75c304c..72035f8237 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java @@ -168,6 +168,19 @@ public class NativeInsertStmt extends InsertStmt { private boolean isFromDeleteOrUpdateStmt = false; + private InsertType insertType = InsertType.NATIVE_INSERT; + + enum InsertType { + NATIVE_INSERT("insert_"), + UPDATE("update_"), + DELETE("delete_"); + private String labePrefix; + + InsertType(String labePrefix) { + this.labePrefix = labePrefix; + } + } + public NativeInsertStmt(InsertTarget target, String label, List cols, InsertSource source, List hints) { super(new LabelName(null, label), null, null); @@ -201,10 +214,11 @@ public class NativeInsertStmt extends InsertStmt { } public NativeInsertStmt(InsertTarget target, String label, List cols, InsertSource source, - List hints, boolean isPartialUpdate) { + List hints, boolean isPartialUpdate, InsertType insertType) { this(target, label, cols, source, hints); this.isPartialUpdate = isPartialUpdate; this.partialUpdateCols.addAll(cols); + this.insertType = insertType; } public boolean isValuesOrConstantSelect() { @@ -366,7 +380,7 @@ public class NativeInsertStmt extends InsertStmt { long timeoutSecond = ConnectContext.get().getExecTimeout(); if (label == null || Strings.isNullOrEmpty(label.getLabelName())) { label = new LabelName(db.getFullName(), - "insert_" + DebugUtil.printId(analyzer.getContext().queryId()).replace("-", "_")); + insertType.labePrefix + DebugUtil.printId(analyzer.getContext().queryId()).replace("-", "_")); } if (!isExplain() && !isTransactionBegin) { if (targetTable instanceof OlapTable) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java index 021840f816..c3afcca68a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java @@ -125,7 +125,7 @@ public class UpdateStmt extends DdlStmt { cols, new InsertSource(selectStmt), null, - isPartialUpdate); + isPartialUpdate, NativeInsertStmt.InsertType.UPDATE); ((NativeInsertStmt) insertStmt).setIsFromDeleteOrUpdateStmt(true); }