DROP ICEBERG TABLE

statementsupportedIceberg & external tables

docs.snowflake.com ↗

Object: ICEBERG TABLE

Removes an Apache Iceberg™ table from the current/specified schema, but retains a version of the Iceberg table so that it can be recovered using UNDROP ICEBERG TABLE. For more information, see Usage Notes (in this topic). Note that this topic refers to Iceberg tables as simply “tables” except where specifying Iceberg tables avoids confusion.

Syntax

supportedpartialnot supportednot scored

DROP [ ICEBERG ] TABLE [ IF EXISTS ] <name> [ CASCADE | RESTRICT ] [ PURGE | NOPURGE ]

Parameters

NameRequiredDescription
nameSpecifies the identifier for the table to drop. If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive (for example, "My Object"). If the table identifier is not fully qualified (in the form of db_name.schema_name.table_name or schema_name.table_name), the command looks for the table in the current schema for the session.
CASCADE | RESTRICTSpecifies whether the table can be dropped if foreign keys exist that reference the table: CASCADE drops the table even if the table has primary/unique keys that are referenced by foreign keys in other tables. RESTRICT returns a warning about existing foreign key references and does not drop the table. Default: CASCADE
PURGEWhen specified for an externally managed Iceberg table in a catalog-linked database, forwards the purge intent in the drop-table request to the external Iceberg catalog. Snowflake does not delete data files directly — the external catalog is responsible for removing the table’s underlying data and metadata files from storage. PURGE can only be used with externally managed Iceberg tables in a catalog-linked database. Using it on a non-externally-managed table, a non-Iceberg table, or a table outside a catalog-linked database results in a compilation error. By default, DROP ICEBERG TABLE doesn’t forward the purge intent; only a statement that specifies PURGE does. To forward the purge intent without specifying PURGE on each statement, set the PURGE_ON_DROP_TABLE parameter to TRUE on the table, schema, or catalog-linked database. For more information, see PURGE_ON_DROP_TABLE.
NOPURGEWhen specified for an externally managed Iceberg table in a catalog-linked database, drops the table without forwarding the purge intent to the external Iceberg catalog, even if the PURGE_ON_DROP_TABLE parameter is set to TRUE on the table, schema, or catalog-linked database. By default, DROP ICEBERG TABLE doesn’t forward the purge intent, so NOPURGE has the same effect as omitting PURGE. You only need NOPURGE to override PURGE_ON_DROP_TABLE = TRUE for a specific drop. NOPURGE can only be used with externally managed Iceberg tables in a catalog-linked database. Using it on a non-externally-managed table, a non-Iceberg table, or a table outside a catalog-linked database results in a compilation error. You can’t specify both PURGE and NOPURGE in the same statement.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP | Iceberg table | OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege). USAGE | External volume | USAGE | Integration (catalog) | Required if the Iceberg table uses an external catalog. Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by