Creating a namespace in a catalog (such as an Apache Iceberg REST catalog or Apache Hive catalog) helps you organize your tables within the Lakehouse runtime catalog.
Before you begin
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the BigLake API.
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 create a namespace, ask your administrator to grant you the following IAM roles on your project:
-
All:
- BigLake Admin (
roles/biglake.admin) - Storage Admin (
roles/storage.admin)
- BigLake Admin (
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Create a namespace
Create a namespace within a catalog.
Considerations
When you create a namespace, you can optionally specify a Cloud Storage bucket or path to associate with the namespace:
- BigLake catalogs: You can set any custom location as long as it is
under a location allowed by the catalog (
default_locationorrestricted_locations). If you do not specify a location, the namespace is created under the catalog's default location (for example,gs://{default_location}/{namespace_name}). Cloud Storage bucket catalogs: The location matches the warehouse bucket.
Console
In the Google Cloud console, open the Lakehouse page.
Select an existing catalog or create one if you don't have one.
In the menu bar, click + Create namespace.
For Namespace name, enter a unique name for your namespace.
For Location, optionally specify a Cloud Storage bucket or path to associate with your namespace. The location matches the warehouse bucket.
Click Create.
Your namespace is created and appears in your catalog details list.
gcloud
To create a namespace using gcloud, run the gcloud biglake iceberg namespaces create command.
gcloud biglake iceberg namespaces create NAMESPACE_NAME \ --project="PROJECT_ID" \ --catalog="CATALOG_ID"
Replace the following:
NAMESPACE_NAME: a name for your namespace.PROJECT_ID: your Google Cloud project ID.CATALOG_ID: the ID of your catalog.
REST
To create a namespace using the REST API, make a POST request to the
CreateIcebergNamespace endpoint:
POST /iceberg/v1/restcatalog/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/namespaces
The request body must contain a valid Iceberg CreateNamespaceRequest JSON payload defining the namespace identifier and properties.
Replace the following:
PROJECT_ID: your Google Cloud project ID.CATALOG_ID: the ID of your catalog.