Delete a table

Deleting or dropping a table only removes the table registration and metadata from the Lakehouse runtime catalog. The underlying data files stored in Cloud Storage are not purged or deleted.

You can delete a table using the Google Cloud console, SQL drop commands in Spark and Trino, or the REST API.

Before you begin

See the table overview to understand the different types of tables and the implications of using them.

Only Apache Iceberg V2 (GA) and V3 (Preview) tables are supported. Iceberg V1 tables aren't supported. To upgrade existing V1 tables, see Upgrade Iceberg V1 tables to V2.

  1. Verify that billing is enabled for your Google Cloud project.

  2. 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 the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

Required roles

To get the permissions that you need to delete a table, ask your administrator to grant you the following IAM roles on your project:

  • All: BigLake Admin (roles/biglake.admin) - your project

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.

Delete a table

Delete a table.

Console

  1. In the Google Cloud console, go to Lakehouse.

    Go to Lakehouse

  2. Select an existing catalog or create one if you don't have one.

  3. In the Namespace details table, select a table and expand the menu options.

  4. Click Delete.

  5. Confirm the deletion by entering the table name in the dialog.

  6. Click Delete.

Spark

spark.sql("DROP TABLE TABLE_NAME;")

Trino

DROP TABLE TABLE_NAME;

gcloud

To delete a table using gcloud, run the gcloud biglake iceberg tables delete command.

gcloud biglake iceberg tables delete TABLE_NAME \
    --project="PROJECT_ID" \
    --catalog="CATALOG_ID" \
    --namespace="NAMESPACE_NAME"

Replace the following:

  • TABLE_NAME: the name of your Iceberg table.
  • PROJECT_ID: your Google Cloud project ID.
  • CATALOG_ID: the ID of your catalog.
  • NAMESPACE_NAME: the name of your catalog namespace.

REST

To delete an Iceberg table registration using the REST API, make a DELETE request to the DeleteIcebergTable endpoint:

DELETE /iceberg/v1/restcatalog/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/namespaces/NAMESPACE_NAME/tables/TABLE_NAME

Replace the following:

  • PROJECT_ID: your Google Cloud project ID.
  • CATALOG_ID: the ID of your catalog.
  • NAMESPACE_NAME: the name of your catalog namespace.
  • TABLE_NAME: the name of your Iceberg table.

What's next