Page 39 - Demo
P. 39
sales_db is named public, within which, table unitsales is constructed as unitsales (customerid, sku, date, qty) and is populated with data.
When you need to plan new inventory with your distributor, you want to provide access to the unit sales data, but not the customer data, which is sensitive. Therefore, a secure view is created from the unitsales table, just for the distributor. The secure view is named distributor_sales_data.
With a modern cloud data warehouse, the steps are accomplished as follows:
1. Create the secure view. Assuming that the database and schema are already created and populated with data, the next step is to create a secure view on the unitsales table:
This logic creates a secure view named, but without the sensitive customerID data. The data included in the view are sku, date, and qty.
2. In the sales_s share container, add privileges for the secure view:
create secure view sales_db.
public.distributor_sales_data as
select sku, date, qty
from sales_db.public.unitsales;
grant usage on database sales_db to
share sales_s;
grant usage on schema sales_db.public
to share sales_s;
grant select on view sales_db.public.
distributor_
sales_data to
share sales_s;
This logic enables the share (container), sales_s to have privileges for the distributor_sales_data secure view.
3. Confirm the contents of the share: desc share sales_s;
CHAPTER4 EnablingLiveDataSharingwithaModernCloudDataWarehouseArchitecture 33 These materials are © 2018 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.