Dynamic Tables
Overview
Dynamic tables simplify data engineering in Snowflake by providing a reliable, cost-effective, and automated way to transform data.
Installation
- Copy the Package ID
@coalesce/dynamic-tables
. - In Coalesce, open the Workspace where you wish to install the package.
- Go to the Build Setting of the Workspace, tab Packages, and click the Install button on the top right of the page.
- Paste the Package ID, and proceed with the installation process.
Description
Dynamic Tables Package
The Dynamic Tables Package includes:
Dynamic Table Work
The Coalesce Dynamic Table Work UDN is a versatile node that allows you to develop and deploy a single Dynamic Table Work or a DAG of Dynamic Tables in Snowflake.
Dynamic tables are a new table type offered by Snowflake that allow data teams to use SQL statements to declaratively define the results of data pipelines. Dynamic tables simplify the process of creating and managing data pipelines by streamlining data transformations without having to manage Streams and Tasks.
Dynamic Table Work Node Configuration
The Dynamic Table Dimension has three configuration groups:
Go to the node and select the Config tab to see the Node Properties, Dynamic Table Options and General Options.
Dynamic Table Work Node Properties
There are four configs within the Node Properties group.
- Storage Location(required): Storage Location where the Dynamic Table will be created.
- Node Type(required): Name of template used to create node objects.
- Description: A description of the node's purpose.
- Deploy Enabled(required):
- If TRUE the node will be deployed or redeployed when changes are detected.
- If FALSE the node will not be deployed or the node will be dropped during redeployment.
Dynamic Table Options
There are three configs within the Dynamic Table Options group.
- Warehouse on which to execute Dynamic Table (required): The name of the warehouse used to refresh the Dynamic Table.
- Downstream(required): True or False Toggle to determine Dynamic Table refresh schedule.
- True - Specifies that the dynamic table should be refreshed on demand when other dynamic tables that depend on it need to refresh.
- False - Allows you to set a Lag Specification for the Dynamic Table refresh.
- Lag Specification: If the Downstream option is set to false you can set the refresh schedule using Lag Specification. Review Snowflakes Dynamic Tables Refresh to understand how to specify the target lag.
- Time Value: Number representing the frequency of refresh for a given Time Period.
- Time Period: Seconds / Minutes / Hours Days related to the entered Time Value.
- Refresh_Mode(required): Specifies the refresh type for the dynamic table.
- AUTO: Enforces an incremental refresh of the dynamic table by default. If the CREATE DYNAMIC TABLE statement does not support the incremental refresh mode, the dynamic table is automatically created with the full refresh mode.
- INCREMENTAL: Enforces an incremental refresh of the dynamic table.
- FULL: Enforces a full refresh of the dynamic table
- Initialize(required): Specifies the behavior of the initial refresh of the dynamic table.
- ON_CREATE: Refreshes the dynamic table synchronously at creation
- ON_SCHEDULE: Refreshes the dynamic table at the next scheduled refresh.
General Options
There are three configs related to the General Options group.
- Distinct: True or False toggle that specifies whether or not to return DISTINCT rows.
- Group By All: True or False toggle that specifies whether or not to add non-aggregated columns to GROUP BY.
- Multi Source: True or False toggle that specifies whether or not multiple sources will be combined using either UNION or UNION ALL.
- Create As:Provides option to choose materialization type as ‘dynamic table’ or ‘transient dynamic table’
- Cluster key: True/False to determine whether Dimension is to be clustered or not
- True -Allows you to specify the column based on which clustering is to be done. -Allow Expressions Cluster Key-True ->allows to add an expression to the specified cluster key
- False – No clustering done