This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch 2.1_47843
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 36f892652f72f89eb5427322451e9c4fbf6b3323
Author: morrySnow <zhangwen...@selectdb.com>
AuthorDate: Thu Feb 13 11:49:32 2025 +0800

    branch-2.1: [fix](Nereids) normalize plan should also lock target table 
#47843
    
    pick from master #47843
---
 .../doris/nereids/trees/plans/commands/insert/InsertUtils.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
index c77789bc0c8..13d00ebfc70 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
@@ -255,6 +255,15 @@ public class InsertUtils {
      * normalize plan to let it could be process correctly by nereids
      */
     public static Plan normalizePlan(Plan plan, TableIf table) {
+        table.readLock();
+        try {
+            return normalizePlanWithoutLock(plan, table);
+        } finally {
+            table.readUnlock();
+        }
+    }
+
+    private static Plan normalizePlanWithoutLock(Plan plan, TableIf table) {
         UnboundLogicalSink<? extends Plan> unboundLogicalSink = 
(UnboundLogicalSink<? extends Plan>) plan;
         if (table instanceof HMSExternalTable) {
             HMSExternalTable hiveTable = (HMSExternalTable) table;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to