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

starocean999 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 78c9d129801 [Chore](nereids) Remove CreateWorkloadGroupStmt (#51822)
78c9d129801 is described below

commit 78c9d1298015d68ca3c6537f8460a04c69a9fd11
Author: csding <[email protected]>
AuthorDate: Thu Jun 19 10:12:58 2025 +0800

    [Chore](nereids) Remove CreateWorkloadGroupStmt (#51822)
---
 fe/fe-core/src/main/cup/sql_parser.cup             |  5 --
 .../doris/analysis/CreateWorkloadGroupStmt.java    | 98 ----------------------
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  3 -
 .../resource/workloadgroup/WorkloadGroupMgr.java   |  5 --
 4 files changed, 111 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 8c33267a568..5f3a598b968 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -1989,11 +1989,6 @@ create_stmt ::=
     {:
         RESULT = new CreateStorageVaultStmt(ifNotExists, storageVaultName, 
properties);
     :}
-    /* workload group*/
-    | KW_CREATE KW_WORKLOAD KW_GROUP opt_if_not_exists:ifNotExists 
ident_or_text:workloadGroupName opt_properties:properties
-    {:
-        RESULT = new CreateWorkloadGroupStmt(ifNotExists, workloadGroupName, 
properties);
-    :}
     /* workload schedule policy */
     | KW_CREATE KW_WORKLOAD KW_POLICY opt_if_not_exists:ifNotExists 
ident_or_text:workloadPolicyName opt_conditions:conditions opt_actions:actions 
opt_properties:properties
     {:
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java
 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java
deleted file mode 100644
index ffa907570f8..00000000000
--- 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java
+++ /dev/null
@@ -1,98 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.apache.doris.analysis;
-
-import org.apache.doris.catalog.Env;
-import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.ErrorCode;
-import org.apache.doris.common.ErrorReport;
-import org.apache.doris.common.FeNameFormat;
-import org.apache.doris.common.UserException;
-import org.apache.doris.common.util.PrintableMap;
-import org.apache.doris.mysql.privilege.PrivPredicate;
-import org.apache.doris.qe.ConnectContext;
-import org.apache.doris.resource.workloadgroup.WorkloadGroup;
-import org.apache.doris.resource.workloadgroup.WorkloadGroupMgr;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Map;
-
-public class CreateWorkloadGroupStmt extends DdlStmt implements 
NotFallbackInParser {
-
-    private final boolean ifNotExists;
-
-    private final String workloadGroupName;
-    private final Map<String, String> properties;
-
-    public CreateWorkloadGroupStmt(boolean ifNotExists, String 
workloadGroupName, Map<String, String> properties) {
-        this.ifNotExists = ifNotExists;
-        this.workloadGroupName = workloadGroupName;
-        this.properties = properties;
-    }
-
-    public boolean isIfNotExists() {
-        return ifNotExists;
-    }
-
-    public String getWorkloadGroupName() {
-        return workloadGroupName;
-    }
-
-    public Map<String, String> getProperties() {
-        return properties;
-    }
-
-    @Override
-    public void analyze(Analyzer analyzer) throws UserException {
-        super.analyze(analyzer);
-
-        // check auth
-        if 
(!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), 
PrivPredicate.ADMIN)) {
-            
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, 
"ADMIN");
-        }
-
-        // check name
-        FeNameFormat.checkWorkloadGroupName(workloadGroupName);
-
-        if (properties == null || properties.isEmpty()) {
-            throw new AnalysisException("Workload Group properties can't be 
empty");
-        }
-
-        String tagStr = properties.get(WorkloadGroup.TAG);
-        if (!StringUtils.isEmpty(tagStr) && 
WorkloadGroupMgr.DEFAULT_GROUP_NAME.equals(workloadGroupName)) {
-            throw new AnalysisException(
-                    WorkloadGroupMgr.DEFAULT_GROUP_NAME
-                            + " group can not set tag");
-        }
-    }
-
-    @Override
-    public String toSql() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("CREATE ");
-        sb.append("RESOURCE GROUP '").append(workloadGroupName).append("' ");
-        sb.append("PROPERTIES(").append(new PrintableMap<>(properties, " = ", 
true, false)).append(")");
-        return sb.toString();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.CREATE;
-    }
-}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
index a816f7b7048..9828513d73f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
@@ -77,7 +77,6 @@ import org.apache.doris.analysis.CreateTableAsSelectStmt;
 import org.apache.doris.analysis.CreateTableStmt;
 import org.apache.doris.analysis.CreateUserStmt;
 import org.apache.doris.analysis.CreateViewStmt;
-import org.apache.doris.analysis.CreateWorkloadGroupStmt;
 import org.apache.doris.analysis.CreateWorkloadSchedPolicyStmt;
 import org.apache.doris.analysis.DdlStmt;
 import org.apache.doris.analysis.DropCatalogStmt;
@@ -294,8 +293,6 @@ public class DdlExecutor {
             env.getResourceMgr().createResource((CreateResourceStmt) ddlStmt);
         } else if (ddlStmt instanceof DropResourceStmt) {
             env.getResourceMgr().dropResource((DropResourceStmt) ddlStmt);
-        } else if (ddlStmt instanceof CreateWorkloadGroupStmt) {
-            
env.getWorkloadGroupMgr().createWorkloadGroup((CreateWorkloadGroupStmt) 
ddlStmt);
         } else if (ddlStmt instanceof DropWorkloadGroupStmt) {
             
env.getWorkloadGroupMgr().dropWorkloadGroup((DropWorkloadGroupStmt) ddlStmt);
         } else if (ddlStmt instanceof CreateWorkloadSchedPolicyStmt) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java
 
b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java
index d187a7c75fd..7abd6da5c5a 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java
@@ -18,7 +18,6 @@
 package org.apache.doris.resource.workloadgroup;
 
 import org.apache.doris.analysis.AlterWorkloadGroupStmt;
-import org.apache.doris.analysis.CreateWorkloadGroupStmt;
 import org.apache.doris.analysis.DropWorkloadGroupStmt;
 import org.apache.doris.analysis.UserIdentity;
 import org.apache.doris.catalog.Env;
@@ -314,10 +313,6 @@ public class WorkloadGroupMgr extends MasterDaemon 
implements Writable, GsonPost
         LOG.info("Create workload group {} for compute group {} success.", 
workloadGroup, computeGroup);
     }
 
-    public void createWorkloadGroup(CreateWorkloadGroupStmt stmt) throws 
DdlException {
-        throw new DdlException("Unsupported create statement");
-    }
-
     // NOTE: used for checking sum value of 100%  for cpu_hard_limit and 
memory_limit
     //  when create/alter workload group with same tag.
     //  when oldWg is not null it means caller is an alter stmt.


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

Reply via email to