page250
337
Let’s assume you are required to do the following:
•
Generate an object containing a client-specific view of data
•
Filter by
region_name
to generate only “Africa” data
•
Mask the
order_key
to prevent identification of individual orders
Over time you can expect to have multiple clients with both differing region filters
and differing masking requirements. I assume your source data product tables and views
contain a complete superset of data.
Filter Engine Model
Figure 9-11 shows the client entitlement, filter engine, and data product model.
Figure 9-11.
Filter engine design
You will now define each entity and focus on the minimal attributes to develop a
simple data model. Feel free to extend them according to your needs later.
While Snowflake does not enforce referential integrity, I will show how to implement
referential integrity to demonstrate the capability, because the optimizer may use
referential integrity to inform internal decision-making. By convention you use a
sequence per object to generate a surrogate primary key.
Filters and masks use substitution variables enclosed in square brackets,
[]
. These
are evident within the corresponding data.
Chapter 9
Client expeCtations