CREATE WAREHOUSE
为计算资源创建一个新的计算集群。
语法
CREATE WAREHOUSE [ IF NOT EXISTS ] <warehouse_name>
[ WITH ] warehouse_size = <size>
[ WITH ] auto_suspend = <nullable_unsigned_number>
[ WITH ] initially_suspended = <bool>
[ WITH ] auto_resume = <bool>
[ WITH ] max_cluster_count = <nullable_unsigned_number>
[ WITH ] min_cluster_count = <nullable_unsigned_number>
[ WITH ] comment = '<string_literal>'
[ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] )
选项
- 选项可以按任意顺序出现,也可以重复出现(以后面的值为准)。
AUTO_SUSPEND、MAX_CLUSTER_COUNT和MIN_CLUSTER_COUNT接受= NULL,以将其重置为0。
示例
以下示例创建了一个启用自动扩展并带有自定义设置的 XLarge 计算集群 (Warehouse):
CREATE WAREHOUSE IF NOT EXISTS 'etl-wh'
WITH warehouse_size = XLarge
auto_suspend = 600
initially_suspended = TRUE
auto_resume = FALSE
max_cluster_count = 4
min_cluster_count = 2
comment = 'Nightly ETL warehouse'
TAG (environment = 'production', team = 'data-engineering', cost_center = 'analytics');
以下示例创建了一个基础的 Small 计算集群:
CREATE WAREHOUSE 'my-warehouse'
WITH warehouse_size = Small;