Study FAQ
How can a Snowflake provider share only approved rows and columns and verify access?
Also asked as 2
- How do I grant and test a secure view in a Snowflake share?
- How can I check that consumers see the intended subset of data in a Snowflake share?
Answer
Expose a secure view that selects the approved columns and filters rows for the intended audience. Grant access to that view through the share, then verify the view's results and the consumer's access. For single-database sharing, provider grants can go directly to the share or through a supported database role.
Make the change with a provider role that can authorize the object grants. If the role also adds or removes consumers, it needs share ownership and the global MANAGE SHARE TARGET privilege. With direct grants, give the share USAGE on the database and schema that hold the view and SELECT on the secure view. If the view also reads objects in other databases in the same provider account, grant REFERENCE_USAGE on each referenced database directly to the share before granting the view. Use the direct grant path for a secure view spanning databases, since database roles cannot carry these reference grants.
Use SHOW GRANTS TO SHARE to inspect the share's grants. A provider can use SIMULATED_DATA_SHARING_CONSUMER to check secure view or secure materialized view output, and a real consumer session is needed to verify the full import, local grants and query path. Recheck grants and exposed rows if a view is recreated, even when its name is unchanged. Removing an account from a direct share ends that account's access to the share. Verify the resulting access after changing the share or replacing one of its objects. Apply the documented requirements for object types such as secure UDFs and for policies separately.
Create and configure shares · Use secure objects to control data access · Share data from multiple databases · Privileges for data sharing · About Secure Data Sharing · SHOW GRANTS
Full explanation
Secure Data Sharing, Marketplace, and Collaboration Models
Study guide · COF-C03
Read the full explanation