UNDROP ICEBERG TABLE¶
Restores the most recent version of a dropped Apache Iceberg™ table.
This topic refers to Iceberg tables as simply “tables” except where specifying Iceberg tables avoids confusion.
Syntax¶
Parameters¶
nameSpecifies the identifier for the table to restore. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| CREATE ICEBERG TABLE | Schema that contained the dropped table |
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.
Usage notes¶
- This command isn’t supported for tables in a catalog-linked database.
- This command isn’t supported for Parquet Direct tables. To recover a dropped
Parquet Direct table, re-create it. You also can’t set the
DATA_RETENTION_TIME_IN_DAYSparameter on a Parquet Direct table. - Restoring Iceberg tables is only supported in the current schema or current database, even if the table name is fully qualified.
- If an Iceberg table with the same name already exists, an error is returned.
- To undrop an Iceberg table whose external volume has been dropped, undrop the external volume first. You can’t undrop the Iceberg table by creating a new external volume with same name as the dropped external volume.
- You can’t restore a table that uses an external catalog if the associated catalog integration has been dropped.
- UNDROP relies on the Snowflake Time Travel feature. An object can be restored only if the object was deleted within the Data retention period. The default value is 24 hours.
Examples¶
Restore the most recent version of a dropped table my_iceberg_table: