You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/create-warehouse.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ CREATE WAREHOUSE [ IF NOT EXISTS ] <warehouse_name>
20
20
[ WITH ] max_cluster_count =<nullable_unsigned_number>
21
21
[ WITH ] min_cluster_count =<nullable_unsigned_number>
22
22
[ WITH ] comment ='<string_literal>'
23
+
[ WITH ] TAG ( <tag_name>='<tag_value>' [ , <tag_name>='<tag_value>' , ... ] )
23
24
```
24
25
25
26
| Parameter | Description |
@@ -38,6 +39,7 @@ CREATE WAREHOUSE [ IF NOT EXISTS ] <warehouse_name>
38
39
|`MAX_CLUSTER_COUNT`|`NULL` or non-negative integer |`0`| Upper bound for auto-scaling clusters. `0` disables auto-scale. |
39
40
|`MIN_CLUSTER_COUNT`|`NULL` or non-negative integer |`0`| Lower bound for auto-scaling clusters; should be ≤ `MAX_CLUSTER_COUNT`. |
40
41
|`COMMENT`| String | Empty | Free-form text surfaced by `SHOW WAREHOUSES`. |
42
+
|`TAG`| Key-value pairs: `TAG ( key1 = 'value1', key2 = 'value2' )`| None | Resource tags for categorization and organization (similar to AWS tags). Used for cost allocation, environment identification, or team ownership. |
41
43
42
44
- Options may appear in any order and may repeat (the later value wins).
43
45
-`AUTO_SUSPEND`, `MAX_CLUSTER_COUNT`, and `MIN_CLUSTER_COUNT` accept `= NULL` to reset to `0`.
@@ -54,7 +56,8 @@ CREATE WAREHOUSE IF NOT EXISTS etl_wh
54
56
auto_resume = FALSE
55
57
max_cluster_count =4
56
58
min_cluster_count =2
57
-
comment ='Nightly ETL warehouse';
59
+
comment ='Nightly ETL warehouse'
60
+
TAG (environment ='production', team ='data-engineering', cost_center ='analytics');
Copy file name to clipboardExpand all lines: docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/index.md
+37-3Lines changed: 37 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,44 @@ Warehouse-related SQL commands for Databend Cloud.
8
8
## General Rules
9
9
10
10
-**Warehouse naming**: 3–63 characters, `A-Z`, `a-z`, `0-9`, and `-` only.
11
-
-**Identifiers**: Bare identifiers may omit quotes when they contain no spaces or special characters; otherwise enclose with single quotes.
12
-
-**Numeric parameters**: Accept integers or `NULL`. Supplying `NULL` resets the value to default (e.g., `AUTO_SUSPEND = NULL` equals `0`).
11
+
-**Strings and identifiers**: Bare identifiers may omit quotes when they contain no spaces; otherwise enclose with single quotes. Grammar allows keywords or numeric/boolean literals as names, but runtime validation still applies.
12
+
-**Numeric parameters**: `nullable_unsigned_number` / `nullable_signed_number` accept integers or `NULL`. Supplying `NULL` resets the value (for example, `AUTO_SUSPEND = NULL` equals `0`).
13
+
-**Time parameters**: `QUERY_HISTORY` uses `YYYY-MM-DD HH:MM:SS` (UTC or explicit timezone). Missing fractional seconds are interpreted as whole seconds.
13
14
-**Boolean parameters**: Only `TRUE`/`FALSE` are accepted.
14
-
-**`WITH` keyword**: May appear before the entire option list or ahead of each option. Options are whitespace-separated.
15
+
-**`WITH` keyword**: May appear before the entire option list or ahead of each option. Options are whitespace-separated; commas are not part of the grammar.
16
+
17
+
## Warehouse Management
18
+
19
+
Tags are key-value pairs that help categorize and organize warehouses, similar to AWS resource tags. They are commonly used for:
20
+
21
+
-**Cost allocation**: Track warehouse costs by team, project, or cost center
22
+
-**Environment identification**: Mark warehouses as dev, staging, or production
23
+
-**Team ownership**: Identify which team owns or manages a warehouse
24
+
-**Custom metadata**: Add any arbitrary metadata for organizational purposes
25
+
26
+
Tag keys and values are arbitrary strings (enclosed in quotes if they contain spaces or special characters). Tags can be:
27
+
- Added at warehouse creation time using `WITH TAG (key = 'value', ...)`
28
+
- Updated or added later using `ALTER WAREHOUSE ... SET TAG key = 'value'`
29
+
- Removed using `ALTER WAREHOUSE ... UNSET TAG key`
30
+
31
+
Tags are returned in API responses and visible through `SHOW WAREHOUSES`.
0 commit comments