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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new b5bdc325af0 [fix](profile) task type not the same in observer and 
master (#39245) (#39698)
b5bdc325af0 is described below

commit b5bdc325af05e55570ec52c2dee9460e16a67861
Author: camby <[email protected]>
AuthorDate: Thu Aug 22 00:31:52 2024 +0800

    [fix](profile) task type not the same in observer and master (#39245) 
(#39698)
    
    pick #39245 to branch-2.1
---
 .../src/main/java/org/apache/doris/qe/StmtExecutor.java       | 11 +++++++++++
 1 file changed, 11 insertions(+)

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 ba79ed73b85..a3644432ab0 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
@@ -671,6 +671,10 @@ public class StmtExecutor {
             if (logicalPlan instanceof Forward) {
                 redirectStatus = ((Forward) logicalPlan).toRedirectStatus();
                 if (isForwardToMaster()) {
+                    // before forward to master, we also need to set 
profileType in this node
+                    if (logicalPlan instanceof InsertIntoTableCommand) {
+                        profileType = ProfileType.LOAD;
+                    }
                     if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) 
{
                         throw new UserException("Forward master command is not 
supported for prepare statement");
                     }
@@ -856,6 +860,13 @@ public class StmtExecutor {
                 analyze(context.getSessionVariable().toThrift());
 
                 if (isForwardToMaster()) {
+                    // before forward to master, we also need to set 
profileType in this node
+                    if (parsedStmt instanceof InsertStmt) {
+                        InsertStmt insertStmt = (InsertStmt) parsedStmt;
+                        if (!insertStmt.getQueryStmt().isExplain()) {
+                            profileType = ProfileType.LOAD;
+                        }
+                    }
                     if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) 
{
                         throw new UserException("Forward master command is not 
supported for prepare statement");
                     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to