Deleting (dropping) an Apache Iceberg view lets you remove a view that you no longer need from the Lakehouse runtime catalog. Deleting a view removes the view registration and purges the view's Identity and Access Management (IAM) policy, but it doesn't affect the underlying Iceberg tables or their data.
You can't delete a namespace that still contains views. Drop all views in a namespace before you delete the namespace.
Before you begin
-
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.enablepermission. 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. - Set up the Lakehouse runtime catalog with the Apache Iceberg REST catalog endpoint.
- Review the limitations of Iceberg views.
Required roles
To get the permissions that you need to delete a view, ask your administrator to grant you the following IAM roles on your project:
-
Delete a view:
BigLake Editor (
roles/biglake.editor) - your project
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to delete a view. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to delete a view:
-
Delete a view:
biglake.views.deleteon the view
You might also be able to get these permissions with custom roles or other predefined roles.
For a complete list of view permissions, see Required roles and permissions.
Delete a view
Delete a view.
Spark
DROP VIEW NAMESPACE_NAME.VIEW_NAME;
To avoid an error if the view doesn't exist, use DROP VIEW IF EXISTS:
DROP VIEW IF EXISTS NAMESPACE_NAME.VIEW_NAME;
Replace the following:
NAMESPACE_NAME: the name of your namespace.VIEW_NAME: the name of your view.
REST
To delete a view using the REST API, make a DELETE request to the
DeleteIcebergView endpoint:
DELETE /iceberg/v1/restcatalog/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/namespaces/NAMESPACE_NAME/views/VIEW_NAME
A successful request returns 204 No Content.
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.VIEW_NAME: the name of your view.
What's next
- Learn how to create a view.
- Learn how to delete a namespace.