使用动态表共享数据
动态表是可共享的对象。要共享动态表,数据共享提供商要将动态表上的权限授予共享,从而供数据共享使用者使用。
如何使用动态表共享数据
要与其他 Snowflake 账户共享动态表,您可以将动态表添加到共享或应用程序包。
- To share a dynamic table with accounts in your region, you can use a Direct Share. For more information, see Data sharing and collaboration in Snowflake.
- To share a dynamic table with accounts in other regions, add the share or application package to a listing as a data product and set up Cross-Cloud Auto-Fulfillment. For more information, see Create and publish a listing.
数据共享提供商可选择在单个动态表上授予 SELECT 权限,也可选择在数据库中所有动态表上授予 SELECT 权限,如以下示例所示。
For more details, see GRANT <privilege> … TO SHARE.
创建动态表以引入共享数据
当您使用动态表引入共享数据时,查询不能从共享动态表或引用上游动态表的共享安全视图中选择。
要创建动态表以引入共享数据,请执行以下操作:
-
Ensure that you have the right privileges, and create a database from a share and grant privileges on it.
-
Grant privileges to the shared database.
-
创建共享动态表。
Note
Change tracking must be enabled on all underlying objects used by a dynamic table. To use a dynamic table to ingest shared data, the data sharing provider needs to enable
change_trackingon the shared object. For more information, see Enable change tracking.