Skip to main content
Version: Latest-3.2

ALTER RESOURCE GROUP

Description

Alters the configuration of a resource group.

tip

This operation requires the ALTER privilege on the target resource group. You can follow the instructions in GRANT to grant this privilege.

Syntax

ALTER RESOURCE GROUP resource_group_name
{ ADD CLASSIFIER1, CLASSIFIER2, ...
| DROP (CLASSIFIER_ID_1, CLASSIFIER_ID_2, ...)
| DROP ALL
| WITH resource_limit
};

Parameters

ParameterDescription
resource_group_nameName of the resource group to be altered.
ADDAdd classifiers to the resource group. See CREATE RESOURCE GROUP - Parameters for more information on how to define a classifier.
DROPDrop classifiers from the resource group via classifier IDs. You can check the ID of a classifier via SHOW RESOURCE GROUP statement.
DROP ALLDrop all classifiers from the resource group.
WITHModify the resource limits of the resource group. See CREATE RESOURCE GROUP - Parameters for more information on how to set resource limits.

Examples

Example 1: Adds a new classifier to the resource group rg1.

ALTER RESOURCE GROUP rg1 ADD (user='root', query_type in ('select'));

Example 2: Drops classifiers with ID 300040, 300041, and 300041 from the resource group rg1.

ALTER RESOURCE GROUP rg1 DROP (300040, 300041, 300041);

Example 3: Drops all classifiers from the resource group rg1.

ALTER RESOURCE GROUP rg1 DROP ALL;

Example 4: modifies the resource limits of the resource group rg1.

ALTER RESOURCE GROUP rg1 WITH (
'cpu_core_limit' = '20'
);