← All notes

Query an Iceberg table at a snapshot, branch, or tag

Answer: Snapshots are created by table operations such as AppendFiles and RewriteFiles. Sequence numbers are assigned when a snapshot is committed. A tag selects the snapshot associated with the specified tag.

Time travel in queries

Queries can time travel to a snapshot or a timestamp. Spark can load a table with a snapshot-id option, or with as-of-timestamp. SQL may use VERSION AS OF or SYSTEM_VERSION AS OF with a snapshot, a branch name, or a tag name. A tag selects the snapshot associated with the specified tag. Note that currently branch cannot be combined with as-of-timestamp. Tags cannot be combined with as-of-timestamp.

end-snapshot-id is the end snapshot ID used in incremental scans, inclusive. Omitting it will default to the current snapshot.

| snapshot-id | tag | |---|---| | one snapshot | snapshot associated with the tag | | as-of-timestamp | cannot combine with branch | | sequence number | assigned when a snapshot is committed |

How snapshots are created

Snapshots are created by table operations, like AppendFiles and RewriteFiles. Sequence numbers are assigned when a snapshot is committed. The Snapshot interface can return this snapshot's sequence number. This timestamp is the same as those produced by currentTimeMillis. A summary is a string map of summary data.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache Iceberg docs, Spark Queries; Apache Iceberg source, Snapshot.java. Apache-2.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Apache Iceberg docs, Spark Queries; Apache Iceberg source, Snapshot.java. Apache-2.0.

Cite this

Permanent ID: iil:note:y3twzagf

iinventedlight. 2026. "Query an Iceberg table at a snapshot, branch, or tag." iinventedlight Library, iil:note:y3twzagf, version of 2026-11-20. https://iinventedlight.com/library/notes/iceberg-snapshots/. License: CC-BY-4.0.

@misc{iil_note_y3twzagf,
  author = {{iinventedlight}},
  title = {{Query an Iceberg table at a snapshot, branch, or tag}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-20},
  url = {https://iinventedlight.com/library/notes/iceberg-snapshots/},
  note = {Permanent ID iil:note:y3twzagf. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/iceberg-snapshots.md.