Rollback table feature
In the event of a problem with your table, you can reset a table to a good state as long as the snapshot of the good table is available. You can roll back the table data based on a snapshot id or a timestamp.
When you modify an Iceberg table, a new snapshot of the earlier version of the table is created. When you roll back a table to a snapshot, a new snapshot is created. The creation date of the new snapshot is based on the Timezone of your session. The snapshot id does not change.
Hive and Impala syntax
ALTER TABLE test_table EXECUTE rollback(snapshotID); ALTER TABLE test_table EXECUTE rollback('timestamp');
Hive and Impala examples
The following example rolls back to an earlier table, creating a new snapshot having a new creation date timestamp, but keeping the same snapshot id 3088747670581784990.
ALTER TABLE ice_t EXECUTE ROLLBACK(3088747670581784990);
The following example rolls the table back to the latest snapshot having a creation timestamp earlier than '2022-08-08 00:00:00'.
ALTER TABLE ice_7 EXECUTE ROLLBACK('2022-08-08 00:00:00')