Menambahkan metadata ke tabel BigQuery
Pelajari cara mulai menggunakan pengelolaan metadata di Dataplex Universal Catalog.
Panduan memulai ini menunjukkan cara menambahkan metadata ke tabel BigQuery. Dalam panduan memulai ini, Anda akan melakukan hal berikut:
Buat set data dan tabel BigQuery berdasarkan set data publik.
Buat template yang menentukan sekumpulan kolom metadata terkait.
Template ini disebut jenis aspek. Kumpulan kolom metadata terkait, yang menjelaskan metadata bisnis dan teknis untuk aset data Anda, disebut aspek.
Menambahkan metadata ke tabel.
Di Dataplex Universal Catalog, setiap aset data ditampilkan sebagai entri. Untuk melampirkan metadata ke aset data, Anda menambahkan aspek ke entri.
Sebelum memulai
- 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.
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
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.enable
permission. Learn how to grant roles. -
Make sure that you have the following role or roles on the project: Dataplex Catalog Admin, BigQuery Data Owner, BigQuery Job User
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Grant access.
-
Di kolom New principals, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Select a role, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
-
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
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.enable
permission. Learn how to grant roles. -
Make sure that you have the following role or roles on the project: Dataplex Catalog Admin, BigQuery Data Owner, BigQuery Job User
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Grant access.
-
Di kolom New principals, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Select a role, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
Di konsol Google Cloud , buka halaman BigQuery Studio.
Membuat set data:
Di panel Explorer, temukan project Anda. Klik
View actions, lalu klik Create dataset.Di kolom Dataset ID, masukkan
catalog_demo_dataset
.Pertahankan nilai default untuk kolom lainnya.
Klik Create dataset.
Menyalin tabel publik ke set data Anda:
Di panel Explorer, telusuri tabel bernama
bigquery-public-data.new_york_citibike.citibike_stations
. Anda mungkin perlu menetapkan cakupan penelusuran untuk menyertakan projectbigquery-public-data
.Tabel ini adalah bagian dari set data Perjalanan NYC Citi Bike, sebuah set data publik yang berisi data tentang program berbagi sepeda.
Pilih tabel
citibike_stations
.Klik Copy. Masukkan informasi sebagai berikut:
- Project: pilih project Anda.
- Dataset: pilih
catalog_demo_dataset
. - Table: masukkan
bike_stations
.
Klik Copy.
Di panel Explorer, cari set data
catalog_demo_dataset
, dan pastikan tabelbike_stations
tercantum dalam set data.Di konsol Google Cloud , buka halaman Catalog Dataplex Universal Catalog.
Klik tab Jenis aspek & template tag, lalu klik tab Kustom.
Klik Create aspect type.
Di kolom ID jenis aspek, masukkan
data-governance-demo
.Untuk Lokasi, pilih
global
.Di bagian Template, klik Add field. Gunakan informasi dalam tabel berikut untuk menambahkan beberapa kolom ke jenis aspek:
Nama Jenis Wajib diisi Deskripsi source-of-data-asset
Teks Tidak - retention-date
Tanggal dan waktu Tidak - data-classification
Enum
Tambahkan nilai
Public
,Sensitive
, danConfidential
.Ya - has-pii
Boolean Ya Whether the data asset has personally identifiable information
Klik Simpan.
Di konsol Google Cloud , buka halaman Penelusuran Dataplex Universal Catalog.
Di kotak penelusuran, masukkan
catalog_demo_dataset
.Pilih tabel bike_stations.
Menambahkan aspek kustom ke entri:
Di bagian Tags & aspek, di samping Tag & aspek opsional, klik
Tambahkan.Pilih jenis aspek
data-governance-demo
.Tindakan ini akan membuat aspek yang menggunakan jenis aspek Anda sebagai template.
Masukkan nilai berikut:
- Sumber aset data:
Copied from NYC Citi Bike Trips public dataset
- Tanggal retensi: masukkan tanggal.
- Klasifikasi data:
Public
- Memiliki PII:
False
- Sumber aset data:
Klik Simpan.
Untuk melihat nilai metadata yang Anda tambahkan, di bagian Tag & aspek, pilih aspek data-governance-demo.
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
Hapus set data:
Di konsol Google Cloud , buka halaman BigQuery Studio.
Di panel Explorer, telusuri set data
catalog_demo_dataset
.Klik
Lihat tindakan, lalu klik Hapus. Konfirmasi saat diminta.
Hapus jenis aspek:
Di konsol Google Cloud , buka halaman Catalog Dataplex Universal Catalog.
Klik tab Jenis aspek & template tag, lalu klik tab Kustom.
Klik jenis aspek
data-governance-demo
.Klik Hapus. Konfirmasi saat diminta.
- Pelajari lebih lanjut pengelolaan metadata.
- Pelajari cara menelusuri resource.
- Pelajari cara menggunakan aspek dan jenis aspek.
Membuat set data dan tabel
Menentukan template metadata: membuat jenis aspek
Menambahkan metadata ke tabel: menambahkan aspek ke entri
Pembersihan
Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.
Menghapus project
Cara termudah untuk menghentikan penagihan adalah dengan menghapus project yang Anda buat untuk panduan memulai ini.
Menghapus resource satu per satu
Jika Anda ingin menggunakan kembali project, hapus resource yang Anda buat.