workload
Sundeck provides the ability to pass a custom “Workload Tag”, as part of the Snowflake warehouse property specified upon connection to Snowflake. If a Workload Tag has been set on the connection, then this tag can be referenced in hook conditions using the WORKLOAD
property.
WORKLOAD [ IS NULL | IS NOT NULL | <comparison-operator> <string-value> ]
The string literal value of the WORKLOAD
tag.
To set a workload tag, simply add the string $<workload-tag>
to the end of the warehouse property specified in the connection string to Snowflake. For example, if the current warehouse property is COMPUTE_WH
, then the workload tag can be set to DASHBOARD_42
by specifying the warehouse property as COMPUTE_WH$DASHBOARD_42
.
The Workload tag is extracted from the warehouse property specified in the connection string to Snowflake.
This property is split into two parts:
- the substring before the last dollar-sign (
$
) is the snowflake warehouse - the substring after the last dollar-sign (
$
) is the workload tag.
Note that a workload tag can be used in place of a warehouse name, or appended to an existing warehouse name. In either case, Sundeck will intercept the workload tag, and can use it to route queries to the desired warehouse.
Connection WAREHOUSE Property | Warehouse Used | Workload Tag |
---|---|---|
$DASHBOARD_42 | null | DASHBOARD_42 |
COMPUTE_WH | COMPUTE_WH | null |
COMPUTE_WH$DASHBOARD_42 | COMPUTE_WH | DASHBOARD_42 |
Warehouse string should be single quoted in order to make sure shell does not interpret dollar sign:
snowsql -a <account name> -u test -h <hostname> -w '$MARKETING_NOTEBOOKS'
snowsql -a <account name> -u test -h <hostname> -w 'COMPUTE_WH$MARKETING_NOTEBOOKS'
To connect via JDBC driver, specify warehouse property by:
properties.put("warehouse", "COMPUTE_WH$MARKETING_NOTEBOOKS");
or directly in the connection string:
String connectStr = "jdbc:snowflake://<hostname>?warehouse=COMPUTE_WH$MARKETING_NOTEBOOKS";
[conn_1]
Driver = /usr/lib64/snowflake/odbc/lib/libSnowflake.so
Description =
Locale=en-US
account=<account>
server=<hostname>
database=SNOWFLAKE_SAMPLE_DATA
warehouse=COMPUTE_WH$MARKETING_NOTEBOOKS
Some tools might require escaping dollar sign, like in Hex for example:
If you encounter any issues when configuring your favorite tool, contact us and we will gladly assist you.
WORKLOAD IS NULL
WORKLOAD IS NOT NULL
WORKLOAD = 'DASHBOARD_42'
WORKLOAD != 'DASHBOARD_42'