From c1fec8c32758f6a1310cfa1b20990cedcf9d9275 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Thu, 31 Oct 2024 20:25:57 +0800 Subject: [PATCH] test --- .../analysis/AlterWorkloadGroupStmt.java | 2 +- .../analysis/CreateWorkloadGroupStmt.java | 2 +- .../workload_manager_p0/test_curd_wlg.groovy | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) 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 index f62c58a6261c353..817a3ee3b2abe3c 100644 --- 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 @@ -71,7 +71,7 @@ public void analyze(Analyzer analyzer) throws UserException { || WorkloadGroupMgr.INTERNAL_GROUP_NAME.equals(workloadGroupName))) { throw new AnalysisException( WorkloadGroupMgr.INTERNAL_GROUP_NAME + " and " + WorkloadGroupMgr.DEFAULT_GROUP_NAME - + " can not set tag"); + + " group can not set tag"); } } 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 index bb84608ebb6fd20..cefcdc0ccbcc54b 100644 --- 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 @@ -83,7 +83,7 @@ public void analyze(Analyzer analyzer) throws UserException { || WorkloadGroupMgr.INTERNAL_GROUP_NAME.equals(workloadGroupName))) { throw new AnalysisException( WorkloadGroupMgr.INTERNAL_GROUP_NAME + " and " + WorkloadGroupMgr.DEFAULT_GROUP_NAME - + " can not set tag"); + + " group can not set tag"); } } diff --git a/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy b/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy index b6668968d642209..f33b8da4f3d5321 100644 --- a/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy +++ b/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy @@ -176,6 +176,30 @@ suite("test_crud_wlg") { exception "can not be greater than 100%" } + // test alter tag and type + test { + sql "alter workload group test_group properties ( 'internal_type'='13' );" + + exception "internal_type can not be create or modified" + } + + test { + sql "create workload group inter_wg properties('internal_type'='123');" + exception "internal_type can not be create or modified" + } + + test { + sql "alter workload group normal properties ('tag'='123')" + + exception "_internal and normal group can not set tag" + } + + test { + sql "alter workload group _internal properties ('tag'='123')" + + exception "_internal and normal group can not set tag" + } + sql "alter workload group test_group properties ( 'cpu_hard_limit'='20%' );" qt_cpu_hard_limit_1 """ select count(1) from ${table_name} """ qt_cpu_hard_limit_2 "select name,cpu_share,memory_limit,enable_memory_overcommit,max_concurrency,max_queue_size,queue_timeout,cpu_hard_limit,scan_thread_num from information_schema.workload_groups where name in ('normal','test_group') order by name;"