Page 36 - Demo
P. 36
Using Modern Cloud Data Sharing
Modern cloud data sharing allows access to database tables and views for any user of a modern cloud data warehouse-as-a-service. When a data provider shares part of its data warehouse with a data consumer, the database object and view are all from within the data provider’s data warehouse environment.
In addition, a modern cloud data warehouse-as-a-service gives data providers granular control of access to database tables and secure views through shares. Data consumers can only query a pro- vider’s database if granted access privileges. Once the data pro- vider creates a share, the data consumer can then query the data.
Instant access, without data copying or movement, is made pos- sible because all database objects are maintained and updated only in a modern cloud data warehouse, and orchestrated by its global metadata management services.
How It All Works
As a data provider, the first step to sharing data is to specify what database tables and views to share with specific data consumers. This is done via a data share object, effectively an “empty shell” that houses the references to the actual database and the shared database objects. Data shares are first-class objects in the modern cloud warehouse environment for which it provides a set of data definition language (DDL) commands for creating and manag- ing shares. Commands include create share, alter share, drop share, and others. Access commands include grant and revoke privileges.
Once a share is created, the data provider grants access to the specific database and database objects it shares. The SQL seman- tics are as follows:
1. Create the share. The following example creates an empty share named sales_s:
create share sales_s;
30 Data Sharing For Dummies, Snowflake Special Edition
These materials are © 2018 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.