createMaterializedView
Last updated: January 27, 2026
Creates a new materialized view in Snowflake with comprehensive data governance features including column-level policies, row access controls, aggregation policies, clustering, tags, and contacts. Materialized views are pre-computed data sets stored as tables that provide query performance benefits. Requires Snowflake Enterprise Edition or higher.
Note: Automatic rollback drops the materialized view.
Known limitation: This change type does not support database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).
Available attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the catalog (database) where the materialized view will be created | No |
| String | Name of the schema where the materialized view will be created | No |
| String | Name of the materialized view to create | Yes |
| String | SELECT query defining the view* | Yes |
| Boolean | Replace the view if it exists using | No |
| Boolean | Only create if the view doesn't exist using | No |
| Boolean | Create a secure view that restricts access to the view definition | No |
| Boolean | Retain access privileges from the original view when using | No |
| String | Clustering expression(s) for query performance optimization | No |
| String | Comment describing the materialized view | No |
| Nested | Column definitions with optional policies and tags | No |
| Nested | Row-level security control for the view | No |
| Nested | Aggregation privacy controls | No |
| Nested | Key-value pairs of tags to apply | No |
| Nested | Key-value pairs mapping contact purposes to contact names | No |
* Snowflake restrictions: No JOINs, subqueries, UDFs, window functions, HAVING, ORDER BY, or LIMIT
** replaceIfExists and ifNotExists are mutually exclusive
columnMaterializedView attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Column name (must match SELECT output exactly) | Yes |
| String | Name of masking policy to apply to this column | No |
| String | Additional columns for masking policy context | No |
| String | Name of projection policy for column queries | No |
| Map | Column-level metadata tags | No |
rowAccessPolicy attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the row access policy | Yes |
| String | Column name the policy applies to | Yes |
aggregationPolicy attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the aggregation policy | Yes |
| String | Column used as the aggregation entity key | Yes |
tags attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Tag name | Yes |
| String | Tag value | Yes |
contacts attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Contact purpose: | Yes |
| String | Contact name | Yes |