You can use the time travel feature in Apache Iceberg to query or roll back historical data of a table.
When you create or delete Apache Iceberg table items, it automatically generates a snapshot and replaces the old data with the snapshot data. You can utilize these snapshots to perform time travel queries and roll back data as it existed at a specific point in time or at a specific snapshot.
When you configure a source transformation in a mapping, you can use the advanced filter option in your Open Table object to configure a time travel query. The query fetches the data based on a timestamp or snapshot ID you specify.
You can use one of the following queries to retrieve the data:
•Query by Timestamp: You can query an Iceberg table as it existed at a particular timestamp. For example, if you want to time travel to October 26, 1986 at 01:21:00, use the following time travel query:
for TIMESTAMP AS OF TIMESTAMP'1986-10-26 01:21:00'
• Query by Snapshot ID : You can query an Iceberg table by specifying a snapshot ID. Each snapshot has a unique identifier. For example, if you want to time travel to a snapshot with ID 10963874102873, use the following time travel query: