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 7ab11dc7e3e [Chore](nereids) remove AlterWorkloadGroupStmt (#54387)
7ab11dc7e3e is described below
commit 7ab11dc7e3ef991f4e5090b12ba5569aca6868a5
Author: yaoxiao <[email protected]>
AuthorDate: Thu Aug 7 15:31:21 2025 +0800
[Chore](nereids) remove AlterWorkloadGroupStmt (#54387)
---
fe/fe-core/src/main/cup/sql_parser.cup | 4 -
.../doris/analysis/AlterWorkloadGroupStmt.java | 86 ----------------------
.../main/java/org/apache/doris/qe/DdlExecutor.java | 3 -
.../resource/workloadgroup/WorkloadGroupMgr.java | 5 --
4 files changed, 98 deletions(-)
diff --git a/fe/fe-core/src/main/cup/sql_parser.cup
b/fe/fe-core/src/main/cup/sql_parser.cup
index 2130b73d08e..c19b7df4dfe 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -1269,10 +1269,6 @@ alter_stmt ::=
{:
RESULT = new AlterTableStmt(tbl, clauses);
:}
- | KW_ALTER KW_WORKLOAD KW_GROUP ident_or_text:workloadGroupName
opt_properties:properties
- {:
- RESULT = new AlterWorkloadGroupStmt(workloadGroupName, properties);
- :}
| KW_ALTER KW_WORKLOAD KW_POLICY ident_or_text:policyName
opt_properties:properties
{:
RESULT = new AlterWorkloadSchedPolicyStmt(policyName, properties);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java
deleted file mode 100644
index a4ab61057a2..00000000000
---
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java
+++ /dev/null
@@ -1,86 +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.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 AlterWorkloadGroupStmt extends DdlStmt implements
NotFallbackInParser {
- private final String workloadGroupName;
- private final Map<String, String> properties;
-
- public AlterWorkloadGroupStmt(String workloadGroupName, Map<String,
String> properties) {
- this.workloadGroupName = workloadGroupName;
- this.properties = properties;
- }
-
- public String getWorkloadGroupName() {
- return workloadGroupName;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public void analyze() throws UserException {
- super.analyze();
-
- // check auth
- if
(!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(),
PrivPredicate.ADMIN)) {
-
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR,
"ADMIN");
- }
-
- 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("ALTER WORKLOAD GROUP
'").append(workloadGroupName).append("' ");
- sb.append("PROPERTIES(").append(new PrintableMap<>(properties, " = ",
true, false)).append(")");
- return sb.toString();
- }
-
- @Override
- public StmtType stmtType() {
- return StmtType.ALTER;
- }
-}
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 0aaa5642ff2..d0bf58d833c 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
@@ -23,7 +23,6 @@ import org.apache.doris.analysis.AlterRepositoryStmt;
import org.apache.doris.analysis.AlterRoleStmt;
import org.apache.doris.analysis.AlterSqlBlockRuleStmt;
import org.apache.doris.analysis.AlterTableStmt;
-import org.apache.doris.analysis.AlterWorkloadGroupStmt;
import org.apache.doris.analysis.AlterWorkloadSchedPolicyStmt;
import org.apache.doris.analysis.CancelExportStmt;
import org.apache.doris.analysis.CancelLoadStmt;
@@ -165,8 +164,6 @@ public class DdlExecutor {
} else if (ddlStmt instanceof RefreshDbStmt) {
RefreshDbStmt refreshDbStmt = (RefreshDbStmt) ddlStmt;
env.getRefreshManager().handleRefreshDb(refreshDbStmt.getCatalogName(),
refreshDbStmt.getDbName());
- } else if (ddlStmt instanceof AlterWorkloadGroupStmt) {
-
env.getWorkloadGroupMgr().alterWorkloadGroup((AlterWorkloadGroupStmt) ddlStmt);
} else if (ddlStmt instanceof CreateIndexPolicyStmt) {
env.getIndexPolicyMgr().createIndexPolicy((CreateIndexPolicyStmt)
ddlStmt);
} else if (ddlStmt instanceof DropIndexPolicyStmt) {
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 bb37ae46551..8baf5d264ed 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
@@ -17,7 +17,6 @@
package org.apache.doris.resource.workloadgroup;
-import org.apache.doris.analysis.AlterWorkloadGroupStmt;
import org.apache.doris.analysis.UserIdentity;
import org.apache.doris.catalog.Env;
import org.apache.doris.common.AnalysisException;
@@ -252,10 +251,6 @@ public class WorkloadGroupMgr implements Writable,
GsonPostProcessable {
}
}
- public void alterWorkloadGroup(AlterWorkloadGroupStmt stmt) throws
DdlException {
- throw new DdlException("Unsupported alter statement");
- }
-
public void alterWorkloadGroup(ComputeGroup cg, String workloadGroupName,
Map<String, String> properties)
throws UserException {
if (properties.size() == 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]