Katalog runtime Lakehouse memungkinkan Anda mengubah konfigurasi dan properti endpoint katalog REST Apache Iceberg atau endpoint katalog Apache Hive yang ada di Lakehouse tanpa batas. Untuk endpoint katalog REST Apache Iceberg, Anda dapat memperbarui mode kredensial, lokasi gudang default, dan jenis katalog. Misalnya, Anda dapat mengupgrade katalog satu bucket ke katalog beberapa bucket (direkomendasikan) sehingga katalog Anda dapat mencakup beberapa bucket penyimpanan.
Sebelum memulai
- Baca Tentang katalog runtime Lakehouse untuk memahami cara kerja katalog runtime Lakehouse dan batasan untuk layanan ini.
- 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. - 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.
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
Verify that billing is enabled for your Google Cloud project.
Enable the BigLake API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
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
Verify that billing is enabled for your Google Cloud project.
Enable the BigLake API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
Peran yang diperlukan
Untuk mendapatkan izin yang Anda perlukan untuk memperbarui katalog, minta administrator untuk memberi Anda peran IAM berikut:
-
Semua:
- BigLake Admin (
roles/biglake.admin) di project Anda - Storage Admin (
roles/storage.admin) di project Anda
- BigLake Admin (
Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.
Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.
Memperbarui katalog
Anda dapat memperbarui katalog menggunakan konsol Google Cloud , gcloud, atau
REST API.
Konsol
Di konsol Google Cloud , buka halaman Lakehouse.
Di baris katalog yang ingin Anda perbarui, klik Tindakan katalog lainnya > Edit.
Di bagian Konfigurasi katalog, ubah setelan yang ingin Anda perbarui.
Pilih Save.
gcloud
Opsi 1: Perbarui properti katalog
Untuk memperbarui properti katalog (seperti deskripsi atau lokasi yang dibatasi),
jalankan perintah gcloud beta biglake iceberg catalogs update:
gcloud beta biglake iceberg catalogs update CATALOG_ID \ --project="PROJECT_ID" \ [--description="DESCRIPTION"] \ [--credential-mode="CREDENTIAL_MODE"] \ [--restricted-locations="RESTRICTED_LOCATIONS"]
Ganti kode berikut:
CATALOG_ID: ID katalog runtime Lakehouse Anda.PROJECT_ID: Google Cloud Project ID Anda.DESCRIPTION: (Opsional) deskripsi untuk katalog.CREDENTIAL_MODE: (Opsional) metode autentikasi. Gunakanend-useruntuk Kredensial pengguna akhir atauvended-credentialsuntuk Mode penyediaan kredensial.RESTRICTED_LOCATIONS: (Opsional) daftar yang dipisahkan koma dari bucket atau jalur penyimpanan tambahan yang diizinkan. Perhatian: Jika Anda menentukan beberapa jalur atau bucket yang tumpang-tindih, hal ini dapat menyebabkan konflik metadata, penimpaan data yang tidak disengaja, atau masalah keamanan seperti kebocoran izin.
Opsi 2: Mengupgrade katalog bucket tunggal ke katalog multi-bucket (direkomendasikan)
Untuk mengupgrade katalog bucket tunggal yang ada ke katalog multi-bucket (direkomendasikan), jalankan perintah gcloud beta biglake iceberg catalogs update dan tetapkan parameter --catalog-type ke biglake:
gcloud beta biglake iceberg catalogs update CATALOG_ID \ --project="PROJECT_ID" \ --catalog-type="biglake"
REST
Opsi 1: Perbarui properti katalog
Untuk mengubah properti katalog (seperti deskripsinya) menggunakan REST API, buat permintaan PATCH
ke endpoint UpdateIcebergCatalog dengan updateMask yang sesuai:
PATCH /iceberg/v1/restcatalog/extensions/projects/PROJECT_ID/catalogs/CATALOG_ID?updateMask=icebergCatalog.description
Isi permintaan harus berisi payload JSON IcebergCatalog dengan kolom yang akan diupdate:
{
"description": "Updated catalog description"
}
Opsi 2: Mengupgrade katalog bucket tunggal ke katalog multi-bucket (direkomendasikan)
Untuk mengupgrade jenisnya menggunakan REST API, buat permintaan PATCH ke endpoint UpdateIcebergCatalog dengan catalogType di updateMask:
PATCH /iceberg/v1/restcatalog/extensions/projects/PROJECT_ID/catalogs/CATALOG_ID?updateMask=icebergCatalog.catalogType
Isi permintaan harus berisi payload JSON IcebergCatalog dengan jenis katalog baru:
{
"catalogType": "BIGLAKE"
}
Ganti kode berikut:
PROJECT_ID: Google Cloud Project ID Anda.CATALOG_ID: ID katalog runtime Lakehouse Anda.
Catatan: Setelah mengupgrade ke katalog multi-bucket, perbarui konfigurasi mesin kueri klien Anda (seperti Spark atau Trino) untuk menentukan jalur gudang menggunakan format bl://:
bl://projects/PROJECT_ID/catalogs/CATALOG_ID.