SnowPro Associate: Platform Question 361
Single answer● Data ExchangeA data provider shares a secure view through a Snowflake data share with an external business partner. After the consumer creates a database from the share, analysts report they can query the shared view but receive errors when the view references a table in another database owned by the provider. The provider wants to make the shared view fully usable without copying data. What should the provider do?
- A
Create a reader account for the consumer so cross-database references in the shared view are resolved automatically
- B
Add the referenced database or objects to the same share so the consumer can access all underlying objects required by the secure view
- C
Convert the secure view to a materialized view because materialized views can be shared without including underlying objects
- D
Grant IMPORTED PRIVILEGES on the provider's database directly to the consumer role so the consumer can resolve the missing reference
Show answer and explanation
Correct answer: B
Explanation
Snowflake sharing is metadata-based and does not copy data. However, when a provider shares a secure view, the consumer must be able to access all supported underlying dependencies required for the view to run. In practice, if a secure view references objects in another database, the provider needs to include those necessary objects in the share as well. This is a common design consideration when publishing data through direct sharing or Data Exchange listings. Reader accounts are useful for organizations without a Snowflake account, but they do not bypass object dependency rules. Likewise, IMPORTED PRIVILEGES is a consumer-side privilege model for using a shared database, not a provider-side mechanism for exposing unresolved dependencies. This aligns with Snowflake documentation on secure data sharing, secure views, and shared object dependency requirements.
- A. Incorrect.
Incorrect. A reader account allows a provider to share data with a party that does not have its own Snowflake account, but it does not automatically fix unresolved cross-database dependencies in a shared secure view. The underlying referenced objects must still be shareable and included appropriately.
- B. Correct.
Correct. For a secure view to function when shared, consumers must be able to access any underlying objects the secure view depends on. If the secure view references objects in another database, the provider must add the necessary referenced objects or database to the share so the dependency can be resolved. This preserves live access without copying data, which is a core benefit of Snowflake data sharing and Data Exchange.
- C. Incorrect.
Incorrect. Materialized views are not the solution to unresolved sharing dependencies in this scenario. Changing the object type does not remove the requirement that shared objects and their dependencies be supported for sharing. The problem is dependency access, not query performance or view persistence.
- D. Incorrect.
Incorrect. IMPORTED PRIVILEGES is granted by the consumer on a shared database they have created from a share, typically to allow roles in the consumer account to use that shared database. It does not let the provider directly grant access into the provider's own database to resolve hidden dependencies across a share.