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:
Create a BigQuery dataset and table based on a public dataset.
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.
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
- 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.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
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.enablepermission.Learn how to grant roles.In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
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.enablepermission.Learn how to grant roles.
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:
- Dataplex Catalog Admin (
roles/dataplex.catalogAdmin) - BigQuery Data Owner (
roles/bigquery.dataOwner) - BigQuery Job User (
roles/bigquery.jobUser)
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
In the Google Cloud console, go to theBigQuery Studio page.
Create a dataset:
In the left pane, clickExplorer:

If you don't see the left pane, clickExpand left pane to open the pane.
In theExplorer pane, find your project. ClickView actions,and then clickCreate dataset.
In theDataset ID field, enter
catalog_demo_dataset.Keep the default values for the other fields.
ClickCreate dataset.
Copy a public table to your dataset:
In theExplorer pane, search for the table named
bigquery-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.
Select the
citibike_stationstable.ClickCopy. Enter the following information:
- Project: select your project.
- Dataset: select
catalog_demo_dataset. - Table: enter
bike_stations.
ClickCopy.
In theExplorer pane, locate the
catalog_demo_datasetdataset, andconfirm that thebike_stationstable is listed in the dataset.
Define a metadata template: create an aspect type
In the Google Cloud console, go to the Dataplex Universal CatalogCatalogpage.
Click theAspect types & tag templates tab, and then click theCustomtab.
ClickCreate aspect type.
In theAspect type ID field, enter
data-governance-demo.ForLocation, select
global.In theTemplate section, clickAdd field. Use the information in the following table to add severalfields to the aspect type:
Name Type Is required Description source-of-data-assetText No - retention-dateDate and time No - data-classificationEnum
Add the values
Public,Sensitive, andConfidential.Yes - has-piiBoolean Yes Whether the data asset has personally identifiable informationClickSave.
Add metadata to the table: add an aspect to the entry
In the Google Cloud console, go to the Dataplex Universal CatalogSearchpage.
In the search box, enter
catalog_demo_dataset.Select thebike_stations table.
Add a custom aspect to the entry:
In theTags & aspects section, next toOptional tags & aspects, clickAdd.
Select the
data-governance-demoaspect type.This creates an aspect that uses your aspect type as a template.
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
- Source of data asset:
ClickSave.
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.
Delete individual resources
If you want to reuse your project, delete the resources that you created.
Delete the dataset:
In the Google Cloud console, go to theBigQuery Studio page.
In the left pane, clickExplorer:

In theExplorer pane, search for the
catalog_demo_datasetdataset.ClickView actions,and then clickDelete. Confirm when prompted.
Delete the aspect type:
In the Google Cloud console, go to the Dataplex Universal CatalogCatalog page.
Click theAspect types & tag templates tab, and then click theCustom tab.
Click the
data-governance-demoaspect type.ClickDelete. Confirm when prompted.
What's next
- Learn more aboutmetadata management.
- Learn how tosearch for resources.
- Learn how towork with aspects and aspect types.
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.