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

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 50370dead9 [fix](load) fix unified load converted failed when 
forwarding to master (#19779)
50370dead9 is described below

commit 50370dead992dcb26ce3a53fded1f13fe37d27f4
Author: Siyang Tang <82279870+tangsiyang2...@users.noreply.github.com>
AuthorDate: Thu May 18 12:28:32 2023 +0800

    [fix](load) fix unified load converted failed when forwarding to master 
(#19779)
---
 .../java/org/apache/doris/qe/StmtExecutor.java     | 26 ++++++++++++----------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index 252e628cb5..f101a40b7f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -598,18 +598,6 @@ public class StmtExecutor {
         if (parsedStmt instanceof QueryStmt) {
             context.getState().setIsQuery(true);
         }
-        if (parsedStmt instanceof UnifiedLoadStmt) {
-            // glue code for unified load
-            final UnifiedLoadStmt unifiedLoadStmt = (UnifiedLoadStmt) 
parsedStmt;
-            unifiedLoadStmt.init();
-            final StatementBase proxyStmt = unifiedLoadStmt.getProxyStmt();
-            parsedStmt = proxyStmt;
-            if (!(proxyStmt instanceof LoadStmt)) {
-                Preconditions.checkState(
-                        parsedStmt instanceof InsertStmt && ((InsertStmt) 
parsedStmt).needLoadManager(),
-                        new IllegalStateException("enable_unified_load=true, 
should be external insert stmt"));
-            }
-        }
 
         try {
             if (context.isTxnModel() && !(parsedStmt instanceof InsertStmt)
@@ -874,6 +862,20 @@ public class StmtExecutor {
             }
         }
 
+        // convert unified load stmt here
+        if (parsedStmt instanceof UnifiedLoadStmt) {
+            // glue code for unified load
+            final UnifiedLoadStmt unifiedLoadStmt = (UnifiedLoadStmt) 
parsedStmt;
+            unifiedLoadStmt.init();
+            final StatementBase proxyStmt = unifiedLoadStmt.getProxyStmt();
+            parsedStmt = proxyStmt;
+            if (!(proxyStmt instanceof LoadStmt)) {
+                Preconditions.checkState(
+                        parsedStmt instanceof InsertStmt && ((InsertStmt) 
parsedStmt).needLoadManager(),
+                        "enable_unified_load=true, should be external insert 
stmt");
+            }
+        }
+
         if (parsedStmt instanceof QueryStmt
                 || (parsedStmt instanceof InsertStmt && !((InsertStmt) 
parsedStmt).needLoadManager())
                 || parsedStmt instanceof CreateTableAsSelectStmt


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

Reply via email to