View and subscribe to listings

As an Analytics Hub subscriber , you can view and subscribe to listings for which you have access. Subscribing to a listing creates a linked dataset in your project.

Required roles

To get the permissions that you need to use listings, ask your administrator to grant you the following Identity and Access Management (IAM) roles on the subscriber project:

For more information about granting roles, see Manage access .

These predefined roles contain the permissions required to perform the tasks in this document. To see the exact permissions that are required to create and query datasets, expand the Required permissionssection:

Required permissions

  • Create new datasets: bigquery.datasets.create or bigquery.datasets.* to perform additional actions on datasets.
  • Query datasets: bigquery.jobs.create or bigquery.jobs.* to perform additional actions on jobs.

You might also be able to get these permissions with custom roles or other predefined roles .

Discover listings

To discover public and private listings, follow these steps:

  1. In the Google Cloud console, go to the Sharing (Analytics Hub)page.

    Go to Sharing (Analytics Hub)

  2. Click Search listings. A dialog appears containing listings that you can access.

  3. To filter listings by their name or description, enter the name or description of the listing in the Search for listingsfield.

  4. In the Filterssection, you can filter listings based on the following fields:

    • Listings: select whether you want to view private listings, public listings, or listings within your org.

    • Categories: select one or more categories.

    • Location: select a location. You can only search by data exchange location. For more information, see Supported regions .

    • Provider: select the data provider. Some data providers require you to request access to their commercial datasets . After requesting access, the data provider contacts you to share their datasets.

  5. Browse through the filtered listings.

Subscribing to a listing gives you read-only accessto the data in the listing by creating a linked dataset in your project.

To subscribe to a listing, follow these steps:

Console

  1. To view a list of listings that you have access to, follow the steps in Discover listings .

  2. Browse through the listings and click a listing that you want to subscribe to. A dialog containing the details of the listing appears. In the Additional detailssection, you can see what regions the provider has made the listing available in.

  3. If you don't have access to subscribe to a listing, such as a listing referencing a commercial dataset , then click Request accessor Purchase via Marketplace. If you click a dataset that you can subscribe to, then click Subscribeto open the Create linked datasetdialog.

  4. If you don't have the Analytics Hub API enabled in your project, an error message appears with a link to enable the API. Click Enable Analytics Hub API.

  5. In the Create linked datasetdialog, specify the following details:

    • Project: specify the name of the project in which you want to add the dataset.
    • Linked dataset name: specify the name of the linked dataset.
    • Primary region: select the region where you want to create the linked dataset.

    • Optional: Replica regions( Preview ): select the region or regions where you want to create additional linked dataset secondary replicas. You might choose to colocate your linked dataset in the same region as your other data to minimize egress and facilitate cross-dataset joins. To create linked dataset replicas, you must have the bigquery.datasets.update permission.

  6. To save your changes, click Save. The linked dataset is listed in your project.

API

Use the projects.locations.dataExchanges.listings.subscribe method .

POST https://analyticshub.googleapis.com/v1/projects/ PROJECT_ID 
/location/ LOCATION 
/dataExchanges/ DATAEXCHANGE_ID 
/listings/ LISTING_ID 
:subscribe

Replace the following:

  • PROJECT_ID : the project ID of the listing that you want to subscribe to.
  • LOCATION : the location for your listing that you want to subscribe to.
  • DATAEXCHANGE_ID : the data exchange ID of the listing that you want to subscribe to.
  • LISTING_ID : the listing ID that you want to subscribe to.

In the body of the request, specify the dataset where you want to create the linked dataset .

To create a subscription with linked dataset replicas available in multiple regions ( Preview ), specify the primary region of the linked dataset using the location field in the request body. For the secondary regions where you want to create linked dataset replicas, you can optionally use the destinationDataset.replica_locations field in the request body and list all the desired secondary replica regions. Ensure that the specified regions in the location property and in the destinationDataset.replica_locations field are regions where the associated listing is available.

If the request is successful, the response body contains the subscription object . If you have enabled subscriber email logging ( Preview ) for the data exchange or listing, the subscription response contains log_linked_dataset_query_user_email: true .

View linked datasets

Linked datasets are displayed together with other datasets in the Google Cloud console.

To view linked datasets in your project, follow these steps:

Console

  1. In the Google Cloud console, go to the BigQuerypage.

    Go to BigQuery

  2. In the Explorerpanel, click your project name that contains thelinked dataset.

Alternatively, you can also use Data Catalog (deprecated) or Dataplex Universal Catalog to search and view linked datasets. To match all BigQuery sharing linked datasets, use the type=dataset.linked predicate. For more information, see Data Catalog search syntax or Dataplex Universal Catalog search syntax .

Cloud Shell

Run the following command:

PROJECT=<your project ID> \
for dataset in $(bq ls --project_id $PROJECT | tail +3); do [ "$(bq show -d --project_id $PROJECT $dataset | egrep LINKED)" ] && echo $dataset; done

Query linked datasets

You can query tables and views in your linked datasets in the same way you would query any other BigQuery table .

Update linked datasets

Resources in a linked dataset are read-only . You can't edit the data or metadata for resources in linked datasets, or specify permissions for individual resources.

You can only update the description and labels of your linked datasets. Changes to a linked dataset don't affect the source or shared datasets.

To update the description and labels of a linked dataset, follow these steps:

  1. In the Google Cloud console, go to the BigQuerypage.

    Go to BigQuery

  2. In the Explorerpanel, click your project name, and then click the linked dataset.

  3. Expand the Actionsoption and click Open.

  4. In the Detailspanel, click Edit detailsand then specify the following details:

    1. To add labels, see Adding a label to a dataset .
    2. To enable collation , expand the Advanced optionssection and follow these steps:

      1. Select Enable default collation.
      2. From the Default collationlist, select an option.
  5. Click Save.

To view the underlying table metadata, query the INFORMATION_SCHEMA.TABLES view:

SELECT * FROM ` LINKED-DATASET 
.INFORMATION_SCHEMA.TABLES`

Replace LINKED-DATASET with the name of your linked dataset.

Unsubscribe from or delete linked datasets

To unsubscribe from a dataset, you must delete the linked dataset. Deleting a linked dataset doesn't delete the source dataset.

You cannot retrieve a linked dataset after you delete it. However, you can recreate the deleted linked dataset by subscribing to the listing again and adding the dataset and the linked datasets created from Google Cloud Marketplace-integrated listings to your project.

If your subscription is removed by an Analytics Hub publisher , then your linked dataset gets unlinked from the shared dataset . Since this is a publisher-initiated action on a subscriber-owned resource, the linked dataset remains dangling in the subscriber's project. The subscriber can remove the dangling dataset by deleting it.

To delete a linked dataset, do the following:

  1. In the Google Cloud console, go to the BigQuerypage.

    Go to BigQuery

  2. In the Explorerpanel, click your project name, and then click the linked dataset.

  3. Expand the Actionsoption and click Delete.

  4. In the Delete linked dataset?dialog, confirm deletion by typing delete.

  5. Click Delete.

What's next

Create a Mobile Website
View Site in Mobile | Classic
Share by: