Materialized View
You can provide configuration to Snowflake Object Lifecycle Engine for the following operation with a materialized view:
- Manage grants of materialized view
Usage
note
We have introduced SOLE for Data Products as a new framework for SOLE to help you easily build an ecosystem of data products. Learn more about SOLE for Data Products which is currently available as a private preview.
- Materialized View in Current Configuration
- Materialized View in SOLE for Data Products
databases:
<database-name>:
schemas:
<schema-name>:
materialized_views:
<materialized-view-name>:
shares:
<privilege>:
- <share-name>
- <share-name>
grants:
<privilege>:
- <grant-name>
- <grant-name>
- materialized_view:
name: <materialized-view-name>
database: rel(database.<database-name>)
schema: rel(schema.<schema-name>)
shares:
<privilege>:
- rel(share.<share-name>)
- rel(share.<share-name>)
grants:
<privilege>:
- rel(role.<grant-name>)
- rel(role.<grant-name>)
Supported parameters
The engine supports the parameters listed below.
Configuration Key | Required/Optional | Data Type and Values | Description |
---|---|---|---|
grants | Optional | Map: See Supported Materialized View Grants to Roles | Lists the Privileges and Roles to which privileges are granted on the current materialized view |
manage_mode | Optional | String: grants (default), none | Configures what properties to manage for the materialized view |
shares | Optional | Map | List of shares to which privileges are granted |
Supported materialized view grants to roles
Following are the privileges you can grant to roles in the materialized view definition:
- ALL PRIVILEGES
- SELECT
- OWNERSHIP
Supported materialized view grants to shares
Following are the privileges you can grant to shares in the materialized view definition
- SELECT
Examples
- Materialized View in Current Configuration
- Materialized View in SOLE for Data Products
databases:
SALES_RECORD:
schemas:
SALES:
materialized_views:
DEV_VIEW:
grants:
SELECT:
- HR_ROLE
- ACCOUNTADMIN
shares:
SELECT:
- DEV_SHARE
- materialized_view:
name: DEV_VIEW
database: rel(database.SALES_RECORD)
schema: rel(schema.SALES)
grants:
SELECT:
- rel(role.HR_ROLE)
- ACCOUNTADMIN
shares:
SELECT:
- rel(share.DEV_SHARE)