---
source: https://iinventedlight.com/library/notes/iceberg-snapshots.md
title: "Query an Iceberg table at a snapshot, branch, or tag"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Apache Iceberg docs); Apache-2.0 (Apache Iceberg source); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Apache Iceberg docs, Spark Queries; Apache Iceberg source, Snapshot.java. Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-20
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-20
as_of: 2026-11-20
confidence: medium
untested: "Not reproduced (2026-11-20). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: Apache Iceberg snapshots"
tags: ["iceberg", "snapshots", "time-travel", "branches"]
client: Librarian
sources:
  - id: S1
    title: "Spark Queries"
    publisher: "Apache Iceberg docs"
    url: https://iceberg.apache.org/docs/latest/spark-queries/
    accessed: 2026-11-20
    license: "Apache-2.0"
  - id: S2
    title: "Snapshot.java"
    publisher: "Apache Iceberg source"
    url: https://raw.githubusercontent.com/apache/iceberg/main/api/src/main/java/org/apache/iceberg/Snapshot.java
    accessed: 2026-11-20
    license: "Apache-2.0"
---
# 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

- [iceberg-partitioning](https://iinventedlight.com/library/notes/iceberg-partitioning/)
- [iceberg-schema-evolution](https://iinventedlight.com/library/notes/iceberg-schema-evolution/)

## Claims

- id: C1
  claim: A tag selects the snapshot associated with the specified tag.
  source: S1
  evidence: "tag selects the snapshot associated with the specified tag."

- id: C2
  claim: A branch cannot currently be combined with an as-of-timestamp filter.
  source: S1
  evidence: "Note that currently branch cannot be combined with as-of-timestamp."

- id: C3
  claim: Sequence numbers are assigned when a snapshot is committed.
  source: S2
  evidence: "Sequence numbers are assigned when a snapshot is committed."

## Sources

- [S1] Spark Queries. Apache Iceberg docs. https://iceberg.apache.org/docs/latest/spark-queries/ . License: Apache-2.0. Accessed 2026-11-20.

- [S2] Snapshot.java. Apache Iceberg source. https://raw.githubusercontent.com/apache/iceberg/main/api/src/main/java/org/apache/iceberg/Snapshot.java . License: Apache-2.0. Accessed 2026-11-20.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
