CONSUMER GROUP

Purpose

Use this statement to create, alter, and drop of consumer groups.

Prerequisite

You need to have the system privilege MANAGE CONSUMER GROUPS.

Syntax

create_consumer_group::=

alter_consumer_group::=

memory_size::=

drop_consumer_group::=

alter_user_set_consumer_group::=

alter_role_set_consumer_group::=

Usage Notes

  • Details about consumer groups is available in Resource Manager section.
  • memory_size can be an integer or a string literal with an integer, optionally followed by unit M (Megabyte), G (Gigabyte), or T (Terabyte). When a unit is not specified, the value is interpreted as Megabyte. You can set the attribute to 'OFF' to disable the limit.
  • The weight of a consumer group has to be between 1 and 1000.
  • time_in_seconds is an integer between 1 and 999999. You can set the attribute to 0 to disable the limit.

Examples

 

CREATE CONSUMER GROUP CEO WITH
 PRECEDENCE = '1000',
 CPU_WEIGHT = '900';
 
CREATE CONSUMER GROUP BI_TEAM WITH
 PRECEDENCE = '900',
 CPU_WEIGHT = '500',
 GROUP_TEMP_DB_RAM_LIMIT = '200G',
 USER_TEMP_DB_RAM_LIMIT = '100G';
 
CREATE CONSUMER GROUP TEST_TEAM WITH
 PRECEDENCE = '800',
 CPU_WEIGHT = '100',
 GROUP_TEMP_DB_RAM_LIMIT = '10G',
 SESSION_TEMP_DB_RAM_LIMIT = '5G';
 QUERY_TIMEOUT = 60;
 IDLE_TIMEOUT=3600;
ALTER CONSUMER GROUP CEO WITH
 PRECEDENCE = '1000',
 CPU_WEIGHT = '800';
 
ALTER CONSUMER GROUP BI_TEAM WITH
 PRECEDENCE = '800',
 CPU_WEIGHT = '500',
 GROUP_TEMP_DB_RAM_LIMIT = '200G',
 USER_TEMP_DB_RAM_LIMIT = '100G';
 
ALTER CONSUMER GROUP TEST_TEAM WITH
 PRECEDENCE = '800',
 CPU_WEIGHT = '150',
 GROUP_TEMP_DB_RAM_LIMIT = '10G',
 SESSION_TEMP_DB_RAM_LIMIT = '5G';
 QUERY_TIMEOUT = 60;
 IDLE_TIMEOUT=3600;
DROP CONSUMER GROUP CEO WITH
 PRECEDENCE = '1000',
 CPU_WEIGHT = '800';
 
DROP CONSUMER GROUP BI_TEAM WITH
 PRECEDENCE = '800',
 CPU_WEIGHT = '500',
 GROUP_TEMP_DB_RAM_LIMIT = '200G',
 USER_TEMP_DB_RAM_LIMIT = '100G';
 
DROP CONSUMER GROUP TEST_TEAM WITH
 PRECEDENCE = '800',
 CPU_WEIGHT = '150',
 GROUP_TEMP_DB_RAM_LIMIT = '10G',
 SESSION_TEMP_DB_RAM_LIMIT = '5G';
 QUERY_TIMEOUT = 60;
 IDLE_TIMEOUT=3600;