Add metadata to a BigQuery table

Learn how to get started with metadata management in Dataplex Universal Catalog.

This quickstart shows you how to add metadata to a BigQuery table.In this quickstart, you do the following things:

  1. Create a BigQuery dataset and table based on a public dataset.

  2. Create a template that defines a set of related metadata fields.

    The template is called anaspect type. The set of related metadatafields, which describe the business and technical metadata for your dataassets, is called anaspect.

  3. Add metadata to the table.

    In Dataplex Universal Catalog, each data asset is represented as anentry. Toattach metadata to a data asset, you add aspects to the entry.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Dataplex and BigQuery APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  7. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Dataplex and BigQuery APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

Required roles

To get the permissions that you need to add metadata to a BigQuery table, ask your administrator to grant you the following IAM roles on the project:

For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

Create a dataset and a table

  1. In the Google Cloud console, go to theBigQuery Studio page.

    Go to BigQuery Studio

  2. Create a dataset:

    1. In the left pane, clickExplorer:

      Highlighted button for the Explorer pane.

      If you don't see the left pane, clickExpand left pane to open the pane.

    2. In theExplorer pane, find your project. ClickView actions,and then clickCreate dataset.

    3. In theDataset ID field, entercatalog_demo_dataset.

      Keep the default values for the other fields.

    4. ClickCreate dataset.

  3. Copy a public table to your dataset:

    1. In theExplorer pane, search for the table namedbigquery-public-data.new_york_citibike.citibike_stations. Youmight need to set the search scope to include thebigquery-public-dataproject.

      This table is part of the NYC Citi Bike Trips dataset, a public datasetthat contains data about a bike share program.

    2. Select thecitibike_stations table.

    3. ClickCopy. Enter the following information:

      • Project: select your project.
      • Dataset: selectcatalog_demo_dataset.
      • Table: enterbike_stations.
    4. ClickCopy.

  4. In theExplorer pane, locate thecatalog_demo_dataset dataset, andconfirm that thebike_stations table is listed in the dataset.

Define a metadata template: create an aspect type

  1. In the Google Cloud console, go to the Dataplex Universal CatalogCatalogpage.

    Go to Catalog

  2. Click theAspect types & tag templates tab, and then click theCustomtab.

  3. ClickCreate aspect type.

  4. In theAspect type ID field, enterdata-governance-demo.

  5. ForLocation, selectglobal.

  6. In theTemplate section, clickAdd field. Use the information in the following table to add severalfields to the aspect type:

    NameTypeIs requiredDescription
    source-of-data-assetTextNo-
    retention-dateDate and timeNo-
    data-classification

    Enum

    Add the valuesPublic,Sensitive, andConfidential.

    Yes-
    has-piiBooleanYesWhether the data asset has personally identifiable information
  7. ClickSave.

Add metadata to the table: add an aspect to the entry

  1. In the Google Cloud console, go to the Dataplex Universal CatalogSearchpage.

    Go to Search

  2. In the search box, entercatalog_demo_dataset.

  3. Select thebike_stations table.

  4. Add a custom aspect to the entry:

    1. In theTags & aspects section, next toOptional tags & aspects, clickAdd.

    2. Select thedata-governance-demo aspect type.

      This creates an aspect that uses your aspect type as a template.

    3. Enter the following values:

      • Source of data asset:Copied from NYC Citi Bike Trips public dataset
      • Retention date: enter a date.
      • Data classification:Public
      • Has PII:False
    4. ClickSave.

  5. To see the metadata values that you added, in theTags & aspectssection, select thedata-governance-demo aspect.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.

Delete the project

The easiest way to stop billing is to delete the project that you createdfor this quickstart.

    Caution: Deleting a project has the following effects:
    • Everything in the project is deleted. If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
    • Custom project IDs are lost. When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as anappspot.com URL, delete selected resources inside the project instead of deleting the whole project.

    If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects can help you avoid exceeding project quota limits.

  1. In the Google Cloud console, go to theManage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then clickDelete.
  3. In the dialog, type the project ID, and then clickShut down to delete the project.

Delete individual resources

If you want to reuse your project, delete the resources that you created.

  1. Delete the dataset:

    1. In the Google Cloud console, go to theBigQuery Studio page.

      Go to BigQuery Studio

    2. In the left pane, clickExplorer:

      Highlighted button for the Explorer pane.

    3. In theExplorer pane, search for thecatalog_demo_dataset dataset.

    4. ClickView actions,and then clickDelete. Confirm when prompted.

  2. Delete the aspect type:

    1. In the Google Cloud console, go to the Dataplex Universal CatalogCatalog page.

      Go to Catalog

    2. Click theAspect types & tag templates tab, and then click theCustom tab.

    3. Click thedata-governance-demo aspect type.

    4. ClickDelete. Confirm when prompted.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.