Lakehouse 執行階段目錄可讓您修改無邊界 Lakehouse 中現有目錄端點的屬性。
如果是 Apache Iceberg REST 目錄端點,您可以更新憑證模式、預設倉儲位置和目錄類型。舉例來說,您可以將單一 bucket 目錄升級為多 bucket 目錄 (建議),讓目錄可以跨多個儲存空間 bucket。
事前準備
- 請參閱「關於 Lakehouse 執行階段目錄」,瞭解 Lakehouse 執行階段目錄的運作方式和服務限制。
- 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.
必要的角色
如要取得更新目錄所需的權限,請要求管理員授予您下列 IAM 角色:
-
全部:
- 專案的 BigLake 管理員 (
roles/biglake.admin) - 專案的儲存空間管理員 (
roles/storage.admin)
- 專案的 BigLake 管理員 (
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
更新目錄
您可以使用 Google Cloud 控制台、gcloud或 REST API 更新目錄。
控制台
在 Google Cloud 控制台開啟「Lakehouse」Lakehouse頁面。
在要更新的目錄列中,依序按一下 「More catalog actions」(更多目錄動作)>「Edit」(編輯)。
在「Catalog configuration」(目錄設定) 下方,修改要更新的設定。
選取「儲存」。
gcloud
方法 1:更新目錄屬性
如要更新目錄屬性 (例如說明或受限制的位置),請執行 gcloud biglake iceberg catalogs update 指令:
gcloud biglake iceberg catalogs update CATALOG_ID \ --project="PROJECT_ID" \ [--description="DESCRIPTION"] \ [--credential-mode="CREDENTIAL_MODE"] \ [--restricted-locations="RESTRICTED_LOCATIONS"]
更改下列內容:
CATALOG_ID:Lakehouse 執行階段目錄的 ID。PROJECT_ID:您的 Google Cloud 專案 ID。DESCRIPTION:(選用) 目錄說明。CREDENTIAL_MODE:(選用) 驗證方式。如要使用使用者憑證,請使用end-user;如要使用憑證臨時配發模式,請使用vended-credentials。RESTRICTED_LOCATIONS:(選用) 以半形逗號分隔的清單,列出其他允許的儲存空間 bucket 或路徑。注意:如果指定多個重疊的路徑或值區,可能會導致中繼資料衝突、意外覆寫資料,或權限外洩等安全性問題。
方法 2:將單一值區目錄升級為多值區目錄 (建議)
如要將現有的單一 bucket 目錄升級為多 bucket 目錄 (建議做法),請執行 gcloud biglake iceberg catalogs update 指令,並將 --catalog-type 參數設為 biglake:
gcloud biglake iceberg catalogs update CATALOG_ID \ --project="PROJECT_ID" \ --catalog-type="biglake"
REST
方法 1:更新目錄屬性
如要使用 REST API 修改目錄屬性 (例如說明),請向 UpdateIcebergCatalog 端點傳送 PATCH 要求,並附上適當的 updateMask:
PATCH /iceberg/v1/restcatalog/extensions/projects/PROJECT_ID/catalogs/CATALOG_ID?updateMask=icebergCatalog.description
要求主體必須包含 IcebergCatalog JSON 酬載,其中含有要更新的欄位:
{
"description": "Updated catalog description"
}
方法 2:將單一值區目錄升級為多值區目錄 (建議)
如要使用 REST API 升級類型,請向 UpdateIcebergCatalog 端點發出 PATCH 要求,並在 updateMask 中加入 catalogType:
PATCH /iceberg/v1/restcatalog/extensions/projects/PROJECT_ID/catalogs/CATALOG_ID?updateMask=icebergCatalog.catalogType
要求主體必須包含 IcebergCatalog JSON 酬載,並指定新的目錄類型:
{
"catalogType": "BIGLAKE"
}
更改下列內容:
PROJECT_ID:您的 Google Cloud 專案 ID。CATALOG_ID:Lakehouse 執行階段目錄的 ID。
注意:升級至多 bucket 目錄後,請更新用戶端查詢引擎設定 (例如 Spark 或 Trino),使用 bl:// 格式指定倉儲路徑:bl://projects/PROJECT_ID/catalogs/CATALOG_ID。