Before you beginModule 18 · Protect query results with governance policies
Why share a queryable object instead of sending another file?
Maple Market used to send a daily sales file to a retail analytics partner. The partner downloaded and stored it. When a sale was corrected, both companies had to agree which version of the file was current. Maple Market now wants the partner to read the current daily totals without repeatedly delivering files or revealing customer emails.
In Snowflake the provider publishes selected objects. A share is a named account object containing grants and allowed consumer accounts. The consumer creates a read-only imported database from that share. A local analyst still needs a role allowed to use the import and a warehouse to run the query.
| Concern | File delivery | Same-region direct share |
|---|---|---|
| Storage | Partner holds the file or loaded copy | Provider holds source data. The import exposes selected objects. |
| Corrections | Send a revised file and arrange reload | Read the same shared view after the provider commits the correction |
| Stopping access | Stop new sends and follow retention rules for old copies | Remove live share access. Previously saved results may remain. |
| No Snowflake at partner | A practical option when approved | Evaluate a provider-managed reader account or another supported delivery product. |
How a direct share reads provider data without importing files
The share adds permissions and metadata. The imported database is a local name for the published objects. Snowflake checks the account invitation, the shared object grants, the consumer’s local role and the view’s access rules. The query uses the consumer’s warehouse to compute an answer. In this same-region path the provider’s stored dataset stays in place. The consumer does not need a copied source table to run the query.
Provider storage and provider pipeline compute stay on the provider’s bill. A regular consumer pays for its query warehouse. Consumer copies, exports and tables created in a separate writable database have their own costs. A reader account shifts warehouse billing to the provider. Cross-region delivery commonly creates a regional copy, with refresh and transfer to plan for.
- Provider databaseGrant access to selected objects to Direct share
- Direct shareMount the approved share to Consumer import
- Consumer warehouseRead the governed object to Consumer import
- Provider database
- Owns sales and the secure daily view.
- Direct share
- Lists object access and approved accounts.
- Consumer import
- Read-only namespace in the consumer account.
- Consumer warehouse
- Executes the query.
Choose which objects belong in a share
Ordinary secure sharing supports tables, dynamic and external tables, secure views, secure materialized views and eligible user-defined functions. Snowflake also documents sharing for supported Iceberg and Delta Lake tables, semantic views, search services and model types. Support depends on the object type, share settings and delivery path. A view is a saved query that can expose selected fields or totals. Grant only the approved objects and check the support matrix before using a specialized object.
Share the secure daily view for this project. Its four fields answer the partner’s question. Keep the order rows and names in private objects. A consumer cannot insert, update or create objects in the imported database, or use Time Travel or cloning on it. They can use authorized reads in other workloads and may still retain results. A future data revocation cannot recall a file they already saved.
Build the secure partner view and check explicit boundaries →
Identify both accounts and verify the region before exchanging access
Run this read-only query in each approved account with the intended lab role. ORG_NAME and ACCOUNT_NAME form the preferred organization-qualified identity used for invitations. ACCOUNT_LOCATOR is the separate value returned by CURRENT_ACCOUNT and used in the case study entitlement map. Compare REGION exactly before choosing a direct share. The rows below are fictional labels.
| Which account | ORG_NAME | ACCOUNT_NAME | ACCOUNT_LOCATOR | REGION |
|---|---|---|---|---|
| Provider | MAPLE_ORG | RETAIL_SANDBOX | MAPLE01 | Same lab region |
| Consumer | PARTNER_ORG | INDIA_SANDBOX | PARTNER01 | Same lab region |
SELECT CURRENT_ORGANIZATION_NAME() AS ORG_NAME,
CURRENT_ACCOUNT_NAME() AS ACCOUNT_NAME,
CURRENT_ACCOUNT() AS ACCOUNT_LOCATOR,
CURRENT_REGION() AS REGION;Interview practice
Explain the decision and the evidence you would use to test it.
What is Secure Data Sharing?
A provider grants selected objects to a share and authorizes consumer accounts. The consumer mounts the share and uses its local roles to query the objects that were exposed.
Who pays to read a same-region share?
The provider keeps paying for its stored data. A regular consumer pays for the warehouse that runs its query. I check separately for reader accounts and remote fulfillment.
Why might I still choose a file?
A partner may need an approved offline snapshot or use a system that cannot consume the share. I would document delivery, versioning, corrections, retention and how the partner removes earlier copies.
Words used in this lesson
- Secure Data Sharing
- Publish read-only access to selected Snowflake objects.
- Provider
- Account that publishes the data.
- Consumer
- Account that imports and queries the share.
- Zero-copy sharing
- Read provider data through a share without creating a consumer storage copy for an ordinary same-region direct share.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Snowflake Secure Data Sharing and zero-copy architecture
Provider, share and consumer in one Snowflake region
The share carries access rules. The provider retains the source and the consumer supplies query compute.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Provider, share and consumer in one Snowflake region
The share carries access rules. The provider retains the source and the consumer supplies query compute.
Provider database → Direct share → Consumer import → Consumer warehouse
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
The datasets are fictional. Results are expected or simulated. Run live steps only in approved test accounts with the documented roles, regions, and feature access.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
A partner in a second cloud requests the same view. What should you check first?
Compare your reasoning
Confirm the consuming region and whether the data may be hosted there, then evaluate regional replication or listing fulfillment.
Connect this lesson to the learning path
Official sources and curriculum
Module 19 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab