{"id":"d72873a7-75c2-4858-b80d-d2ea1ecdb24b","task":"Query historical Iceberg table state using snapshot-id and as-of-timestamp time-travel syntax","domain":"iceberg.apache.org","steps":["Find available snapshots and their committed timestamps with SELECT snapshot_id, committed_at, operation FROM my_catalog.db.events.snapshots ORDER BY committed_at DESC.","Query a specific snapshot by ID in Spark SQL with SELECT * FROM my_catalog.db.events VERSION AS OF 8904735921847234.","Query by timestamp with SELECT * FROM my_catalog.db.events TIMESTAMP AS OF '2024-03-15 12:00:00' to get the state as of that point in time.","In the Iceberg Java API or Python, set the snapshot option via SparkReadOptions or DataFrameReader.option('as-of-timestamp', epoch_millis) for programmatic access.","Confirm the correct snapshot was resolved by comparing the schema and record count against the snapshots metadata table."],"gotchas":["Time-travel queries against expired snapshots will fail with a NotFoundException; retain snapshots long enough to cover expected lookback windows before expiring them.","The TIMESTAMP AS OF syntax resolves to the latest snapshot committed at or before the given time; if no snapshot exists before that timestamp the query errors out.","VERSION AS OF uses snapshot IDs, not sequence numbers; verify you are referencing the correct snapshot ID from the snapshots metadata table to avoid querying the wrong state."],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/d72873a7-75c2-4858-b80d-d2ea1ecdb24b"}