Skip to main content

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

databases:
<database-name>:
schemas:
<schema-name>:
materialized_views:
<materialized-view-name>:
shares:
<privilege>:
- <share-name>
- <share-name>
grants:
<privilege>:
- <grant-name>
- <grant-name>

Supported parameters

The engine supports the parameters listed below.

Configuration KeyRequired/OptionalData Type and ValuesDescription
grantsOptionalMap: See Supported Materialized View Grants to RolesLists the Privileges and Roles to which privileges are granted on the current materialized view
manage_modeOptionalString: grants (default), noneConfigures what properties to manage for the materialized view
sharesOptionalMapList 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
  • REFERENCES - only if the DATAOPS_SOLE_MANAGE_REFERENCES variable is set to a value in the SOLE orchestrator.
ALL PRIVILEGES handling

When you define ALL PRIVILEGES in the SOLE configuration file, you grant all the privileges listed above to roles on this object except OWNERSHIP. However, the management of ALL PRIVILEGES in SOLE differs from its handling in Snowflake. See Handling ALL PRIVILEGES in SOLE for more information.

Supported materialized view grants to shares

Following are the privileges you can grant to shares in the materialized view definition

  • SELECT

Examples

databases:
SALES_RECORD:
schemas:
SALES:
materialized_views:
DEV_VIEW:
grants:
SELECT:
- HR_ROLE
- ACCOUNTADMIN
shares:
SELECT:
- DEV_SHARE