Supported object types in DCM Projects¶
The DEFINE statement is a special command used exclusively in DCM project definition files. Its syntax is similar to the CREATE OR ALTER command, but with the following key differences:
The order and location of DEFINE statements don’t matter. Snowflake collects and sorts all statements from all definition files during project execution.
If you remove a DEFINE statement that was previously deployed, Snowflake drops the corresponding object the next time you deploy the project. The same applies to GRANT and ATTACH statements that are removed after being previously deployed.
Only a subset of Snowflake object types are supported.
All objects must be defined with a fully qualified name (
database.schema.object_name).References to other objects must with fully qualified names.
The following object types are natively supported in DCM Projects definition files with the DEFINE, GRANT, or ATTACH statements.
Authentication policy
Database¶
🚫 Unsupported changes:
Any CREATE OR ALTER limitation, including renaming the database
Schema¶
🚫 Unsupported changes:
Any CREATE OR ALTER limitation, including renaming the schema
Table¶
🚫 Unsupported changes:
Any CREATE OR ALTER limitation, including the following operations:
Renaming tables
Renaming columns
Reordering columns
Changing column types to incompatible types
Adding search optimization to a table or columns
Adding tags and policies to a table or columns
Dynamic table¶
✅ Supported changes:
Without a full refresh:
Warehouse
Target-lag
With re-initialization or a full refresh:
Refresh mode
Any changes of the body including:
Dropping columns
Adding columns at the end
⚠️ Immutable arguments:
INITIALIZE
🚫 Unsupported changes:
Any CREATE OR ALTER limitation, including the following operations:
Reordering columns
Renaming dynamic tables
View¶
🚫 Unsupported changes:
Any CREATE OR ALTER limitation, including the following operations:
Renaming views
Reordering columns
Internal stage¶
✅ Supported changes:
Directory table
Comment
⚠️ Immutable attributes:
Encryption type
Warehouse¶
⚠️ Immutable attributes:
INITIALLY_SUSPENDED
Role and Database Role¶
🚫 Unsupported types:
Application Role
Grant¶
🚫 Unsupported GRANT types:
APPLICATION ROLE grants
CALLER grants
Note
When removing a GRANT OWNERSHIP statement that was previously deployed, DCM Projects attempt to use the current owner role to grant the ownership back to the DCM project owner. If the project owner role doesn’t hold the object’s owner role, then ownership needs to be transferred back manually outside of DCM Projects.
DCM Projects is only aware of grants that were defined and deployed through DCM Projects. Any grants that were added outside of DCM Projects coexist, and DCM Projects do not remove them.
Data metric function¶
Data metric functions (DMFs) let you define data quality expectations and attach those expectations to tables. You can select from existing system DMFs or write your own user-defined data metric functions (UDMFs). You can then attach them to tables, views, and dynamic tables with a many-to-many relationship. For more information, see Use SQL to set up data metric functions.
To attach data metric functions, you first need to add a DATA_METRIC_SCHEDULE to each table, dynamic table, or view definition. For
example: DATA_METRIC_SCHEDULE = TRIGGER_ON_CHANGES. The TRIGGER_ON_CHANGES schedule is not available for views.
The user-defined names of expectations must be unique per project and attachment.
Defining expectations is optional, but recommended, when attaching DMFs to table columns.
Attached DMFs without set expectations aren’t considered when running EXECUTE DCM PROJECT <my_project> TEST ALL.
✅ Supported changes:
Defining UDMFs (user-defined data metric functions)
Attaching system DMFs and UDMFs to tables, views, or dynamic tables inside and outside a DCM project
Defining data expectations for table columns
Example:
An example of defining a UDMF:
An example of attaching a system DMF with an expectation:
An example of attaching a UDMF with an expectation:
To see all available system DMFs, query SHOW DATA METRIC FUNCTIONS IN DATABASE SNOWFLAKE.
Task¶
When definition changes are deployed for a task that is already started, Snowflake automatically suspends that task (or its root task) temporarily, applies the change, and then resumes it again.
Newly deployed tasks are suspended by default.
🚫 Unsupported changes:
Limitations in CREATE OR ALTER TASK statements. See CREATE TASK for more information.
SQL function¶
🚫 Unsupported changes:
Limitations in CREATE OR ALTER statements. See CREATE FUNCTION for more information.
Tag¶
🚫 Unsupported attributes:
Propagate