Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

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.

Syntax

WORKLOAD [ IS NULL | IS NOT NULL | <comparison-operator> <string-value> ]

Returns

The string literal value of the WORKLOAD tag.

How to Specify 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 PropertyWarehouse UsedWorkload Tag
$DASHBOARD_42nullDASHBOARD_42
COMPUTE_WHCOMPUTE_WHnull
COMPUTE_WH$DASHBOARD_42COMPUTE_WHDASHBOARD_42

Examples on how to specify workload tag with some database clients and tools

Snowsql

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'

JDBC driver connection

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";

ODBC driver connection

[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:

Home Page

If you encounter any issues when configuring your favorite tool, contact us and we will gladly assist you.

Example usage in hook conditions

WORKLOAD IS NULL
WORKLOAD IS NOT NULL
WORKLOAD = 'DASHBOARD_42'
WORKLOAD != 'DASHBOARD_42'