Preparing and using data for analysis · Topic 3 of 3
Sharing Data, Datasets and Reports
Define sharing rules, publish datasets and reports, and use BigQuery sharing (Analytics Hub) listings and data clean rooms to share without copies.
- 5 min
- Define who, what, how and who pays before choosing a mechanism.
- Authorized views and datasets share subsets without source access.
- BigQuery sharing listings create read-only linked datasets with no copy.
What it is
Sharing data means giving other teams, partners or the public access to data and insights without losing control of it. You define the rules, publish datasets or reports, and prefer mechanisms that share live data in place over exported copies that go stale and escape governance.
How it works
Defining rules to share data
Answer four questions before choosing a mechanism.
| Question | Typical controls |
|---|---|
| Who receives it? | Internal groups, partner organizations, the public |
| What may they see? | Whole tables, a subset through views, masked columns, filtered rows, aggregates only |
| How may they use it? | Query only; copying and export restricted; aggregate results only |
| Who pays? | Provider pays storage; consumers pay for their own queries |
Organization policies still apply. Domain restricted sharing blocks IAM grants to outside identities, so partner sharing needs the partner's customer ID added to the allowed list or a policy exception on the sharing project.
Sharing mechanisms in BigQuery
| Mechanism | Fits |
|---|---|
| IAM on a dataset or table | Internal teams that need the whole object |
| Authorized view or authorized dataset | A subset of columns or rows, without access to the source tables |
| Row access policies and policy tag masking | The same table with different visibility per group |
| BigQuery sharing (Analytics Hub) listing | Curated, discoverable sharing with many internal or external subscribers |
| Data clean room | Partners combine data for joint analysis without seeing each other's rows |
-- a partner-safe view in its own dataset
CREATE VIEW partner_share.p42_orders AS
SELECT order_id, order_date, sku, qty
FROM sales.order_facts
WHERE partner_id = 'P42';
GRANT `roles/bigquery.dataViewer`
ON SCHEMA partner_share
TO 'group:analysts@partner42.example';
The view must also be added as an authorized view on the sales dataset, so it can read the source while the partner cannot.
BigQuery sharing (Analytics Hub)
| Concept | Meaning |
|---|---|
| Data exchange | A container for listings, private to chosen users or public |
| Listing | A shared dataset with description, documentation and contact |
| Linked dataset | Created in the subscriber's project; read-only and live, with no copy |
| Subscriber permissions | Granted on the exchange or listing |
| Egress controls | Restrict copying and exporting of shared data |
| Usage metrics | Show the provider who subscribes and how data is used |
Subscribers query the linked dataset with their own project, so they pay for their queries. The provider updates the source once and every subscriber sees the change.
"Share with many partners, let them discover and subscribe, keep one copy, and stop them exporting the data" is the description of BigQuery sharing listings with egress controls.
Data clean rooms
A data clean room is a type of exchange where providers add analysis rules. With an aggregation threshold, subscribers can only see results that group at least a set number of entities, never individual rows. Differential privacy rules add calibrated noise for stronger guarantees.
Publishing datasets
| Audience | Approach |
|---|---|
| Internal organization | Private exchange with listings per data product |
| Public or open data | Public listing, or a dataset readable by all authenticated users |
| Paying customers | Commercial listing through Google Cloud Marketplace |
| Files for many readers | Cloud Storage with Requester Pays, so downloaders pay transfer costs |
Publishing reports and visualizations
| Tool | Sharing options |
|---|---|
| Looker Studio | Share as viewer or editor with users or groups, link sharing, scheduled email delivery |
| Looker | Folder permissions, scheduled deliveries, embedded dashboards in applications |
| Connected Sheets | Share the sheet; viewers need BigQuery access to refresh |
Check the data source credentials before publishing a report widely. Owner's credentials expose whatever the owner can see to every viewer.
A worked example
A payments company wants to share daily merchant statistics with 300 partner banks, and bank analysts must not export raw rows. It also wants to measure overlap between its customers and one retailer's customers without either side seeing the other's list.
The engineer publishes a curated dataset as a listing in a private exchange, grants each bank subscriber access and turns on egress restrictions. For the retailer, a data clean room with an aggregation threshold lets both sides count matches only in groups.
How the exam asks about this
- "Share a live dataset with external partners without copying it, and let the provider see usage." A BigQuery sharing (Analytics Hub) listing; partners subscribe with linked datasets.
- "Partners may query only five columns of a table that also holds PII." An authorized view in a separate dataset shared with the partner.
- "Two companies must analyse combined customer data without exposing individual records." A data clean room with an aggregation threshold analysis rule.
What to remember for the exam
- Define who, what, how and who pays before choosing a mechanism.
- Authorized views and datasets share subsets without source access.
- BigQuery sharing listings create read-only linked datasets with no copy.
- Egress controls restrict copying and exporting of shared data.
- Data clean rooms enforce aggregate-only analysis between parties.
Exporting tables to CSV for partners breaks governance. The copy goes stale, cannot be revoked and escapes masking and audit logs.
Common mistakes
Copying data into each partner's project. Linked datasets share one live source instead.
Granting partners access to the source dataset. Share a view or listing, not the raw tables.
Forgetting who pays. Subscribers pay for their own queries on linked datasets; design budgets accordingly.
Check yourself
What does a subscriber get when subscribing to a BigQuery sharing listing?
A read-only linked dataset in their own project that reads the provider's live data without a copy.
Why must a shared view be authorized on the source dataset?
An authorized view can read the source tables on behalf of users who have no access to those tables.
Which feature lets two parties join data while only seeing aggregated results?
A data clean room with analysis rules such as an aggregation threshold.
Topic 3 of 3 in Preparing and using data for analysis
Test yourself on Preparing and using data for analysis
The full Google Cloud Professional Data Engineer question bank has 733 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.