diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index 9a22c3d96e..e9dd9ec582 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -1785,7 +1785,7 @@ public class SessionVariable implements Serializable, Writable { @VariableMgr.VarAttr(name = LOAD_STREAM_PER_NODE) public int loadStreamPerNode = 2; - @VariableMgr.VarAttr(name = GROUP_COMMIT) + @VariableMgr.VarAttr(name = GROUP_COMMIT, needForward = true) public String groupCommit = "off_mode"; @VariableMgr.VarAttr(name = ENABLE_PREPARED_STMT_AUDIT_LOG, needForward = true) 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 a5ff53cb90..e490fa2b1c 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 @@ -711,13 +711,6 @@ public class StmtExecutor { + Env.getCurrentEnv().getSelfNode().getHost() + ") and failed to execute" + " because Master FE is not ready. You may need to check FE's status")); } - if (context.getSessionVariable().isEnableInsertGroupCommit()) { - // FIXME: Group commit insert does not need to forward to master - // Nereids does not support group commit, so we can not judge if should forward - // Here throw an exception to fallback to legacy planner and let legacy judge if should forward - // After Nereids support group commit, we can remove this exception - throw new NereidsException(new UserException("Nereids does not support group commit insert")); - } forwardToMaster(); if (masterOpExecutor != null && masterOpExecutor.getQueryId() != null) { context.setQueryId(masterOpExecutor.getQueryId()); @@ -1354,6 +1347,8 @@ public class StmtExecutor { if (context.getSessionVariable().isEnableInsertGroupCommit() && parsedStmt instanceof NativeInsertStmt) { NativeInsertStmt nativeInsertStmt = (NativeInsertStmt) parsedStmt; nativeInsertStmt.analyzeGroupCommit(new Analyzer(context.getEnv(), context)); + redirectStatus = parsedStmt.getRedirectStatus(); + isForwardedToMaster = shouldForwardToMaster(); } redirectStatus = parsedStmt.getRedirectStatus(); }