Snapshot management

From Hive, you can manage the lifecycle of snapshots using branches and tags. Branches are references to snapshots that have a lifecycle of their own. Tags identify snapshots you need for auditing and conforming to GDPR.

You can expire snapshots, list snapshots of a table, use a snapshot to rollback to a version of a table, and perform other snapshot management operations described in this documentation.

Managing snapshots using branches and tags

Iceberg branches and tags are available in Hive to reference snapshots for managing snapshot lifecycles. Branches track the ancestral relations of snapshots and point to the snapshot root. Cloudera recommends that you use this feature in test and development environments. It is not recommended for production deployments. Iceberg branches and tags are not supported in Impala or Spark.

Set the current snapshot from Hive

The following Hive syntax for sets the current snapshot using an ID or timestamp:

ALTER TABLE <table name> EXECUTE SET_CURRENT_SNAPSHOT (<snapshot ID>)

For example:

ALTER TABLE t EXECUTE SET_CURRENT_SNAPSHOT (7521248990126549311)