ALTER SUNDECK TABLE
Pinned tables allow you to pin the contents of an existing Snowflake table in Sundeck.
The pinned table(s) can then be referenced in conditions in Sundeck flows or hooks.
For instance, Pin tables can be used in conditions like, REFERENCED_TABLES
, UNIQUE_REFERENCED_TABLES
.
ALTER SUNDECK TABLE
allows you to alter one pin table at a time.
Use these commands to enable or disable pinning for a Snowflake Table.
Service account user needs to be granted Snowflake USAGE privilege to database and schema of the pinned table as well as SELECT privilege for pinned table itself.
Start using Snowflake table/view as a pin table:
ALTER SUNDECK [TABLE|VIEW] <IDENTIFIER> PIN=TRUE REFRESH_FREQUENCY_SECONDS=300;
Refresh pinned copy of the table/view:
ALTER SUNDECK [TABLE|VIEW] <IDENTIFIER> REFRESH PINNED COPY;
Stop using Snowflake table/view as a pin table:
ALTER SUNDECK [TABLE|VIEW] <IDENTIFIER> PIN=FALSE;
<IDENTIFIER>
- Specifies the identifier for the Snowflake table to be used as Pin table. If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive (e.g. “My Table”).
test#DEMO.PIN> alter sundeck table DEMO.pin.BigTables pin=true refresh_frequency_seconds=60;
+-------------+-----------------+----------------+-------------------------------+-----------------+-----------------------------------------+-------------------------------+
| PIN_DB_NAME | PIN_SCHEMA_NAME | PIN_TABLE_NAME | PIN_REFRESH_FREQUENCY_SECONDS | PIN_CREATED_BY | PIN_CREATED_AT | PIN_LAST_REFRESHED_AT |
|-------------+-----------------+----------------+-------------------------------+-----------------+-----------------------------------------+-------------------------------|
| DEMO | PIN | BIGTABLES | 60 | test@sundeck.io | 2023-11-02 13:31:07.970645796 +0000 UTC | 2023-11-02 13:31:08 +0000 UTC |
+-------------+-----------------+----------------+-------------------------------+-----------------+-----------------------------------------+-------------------------------+
1 Row(s) produced. Time Elapsed: 0.887s