Part 5 · Apache Iceberg spec · Chapter 16
The Iceberg metadata tree
Iceberg from the root pointer down: the table metadata file, snapshots, the manifest list, manifests and data files, sequence-number inheritance, and how a scan prunes the tree before it reads a byte of data.
After this chapter you should be able to:
- Draw the metadata tree and name every file type and who writes it.
- Explain what a fast append writes and why manifests are reused across snapshots.
- Explain sequence-number inheritance and why entries are written with nulls.
- Walk scan planning: inclusive projection, manifest pruning by partition summaries, file pruning by column stats, residuals.
- Compare format versions 1, 2, 3 and the in-progress 4.
Delta keeps a table’s history as a log of actions that readers replay (chapter 9). Iceberg keeps it as a tree of immutable files that readers walk from the top. Both are “a catalog of data files plus atomic commits”, but the shape changes what is cheap. In Iceberg, finding the current state means reading a few files no matter how long the history is. Planning a query can skip whole subtrees using statistics stored at each level.
The spec is pinned to apache/iceberg commit 9d2bf51, and Java links point to the reference implementation at the same commit. This chapter covers format versions 1 to 3, which are adopted. Version 4 is “under active development and has not been formally adopted”, and gets a section of its own at the end.[spec]
Why Iceberg exists
Hive tables, the default before table formats, defined a table as the files under a directory tree, with partitions registered in a metastore. Planning a query meant listing directories, which grows with the number of partitions and files. A write was visible file by file as it landed, and nothing tracked file-level statistics. Iceberg’s design goals answer those problems directly:[spec]
- Serializable isolation. Reads use a committed snapshot and take no locks. A write that adds and removes files is never partially visible.
- Speed. Planning takes “O(1) remote calls … and not O(n) where n grows with the size of the table”.
- Scale. Planning happens in clients and doesn’t bottleneck on a central metastore.
- Evolution. Schemas and partition specs can change safely (chapters 18 and 19).
- Storage separation. “Reads will be planned using predicates on data values, not partition values.” Users filter on
ts, not on a derived partition column.
The key move is to track individual files instead of directories. Writers create data files anywhere, and those files join the table only in an explicit commit.[spec]
Q1. Iceberg's "speed" goal is about the number of remote calls to plan a scan. What should it not grow with?
Q2. When does a data file a writer has just written become part of an Iceberg table?
The tree
From the top:
- The catalog pointer. The catalog knows one thing per table: the location of the current table metadata file.
- Table metadata (
<version>-<uuid>.metadata.json): schemas, partition specs, sort orders, properties, and the list of snapshots. - A snapshot (inside the metadata file): one state of the table. It points to a manifest list.
- The manifest list (
snap-<snapshot-id>-<attempt>-<uuid>.avro): one row per manifest, with counts and partition summaries. - Manifests (
<uuid>-m<n>.avro): one row per data or delete file, with its partition tuple and column statistics. - Data files (Parquet, ORC or Avro) and delete files (chapter 20).
Every file below the pointer is immutable. A commit writes new files bottom-up and then swaps the pointer: “All changes to table state create a new metadata file and replace the old metadata with an atomic swap.”[spec] With a metastore catalog, the swap is a check-and-put of the pointer from version V to V+1. The older scheme for file-system tables, an atomic rename to v<V+1>.metadata.json, is deprecated and called unsafe on object stores.[spec][spec] The Java implementation names metadata files %05d-<uuid>.metadata.json.[src] Chapter 17 covers commits and retries.
- Catalog pointer Find the current table metadata file.
- Table metadata Choose a snapshot and follow its manifest-list reference.
- Manifest list Select manifests using their partition summaries.
- Data-file entries Partition tuples, file paths and column metrics.
- Delete-file entries Delete paths and metadata used to match them to data files.
Table metadata
The metadata file is JSON. The fields you’ll meet most often are:[spec]
| Field | What it holds |
|---|---|
format-version, table-uuid, location | Version (readers must throw if it’s higher than they support), identity (must not change across refreshes), base location |
schemas, current-schema-id, last-column-id | Every schema the table has had, the current one, and the highest column id ever assigned |
partition-specs, default-spec-id, last-partition-id | Every partition spec, the one writers use, and the highest partition field id |
sort-orders, default-sort-order-id | Sort orders for writers |
snapshots, current-snapshot-id, refs | Valid snapshots, the current one (which must equal the main branch), and named branches and tags |
last-sequence-number | The highest sequence number assigned (v2+) |
snapshot-log, metadata-log | History of current-snapshot changes and of previous metadata files |
next-row-id | The next row id to assign (v3 row lineage) |
Readers never use default-spec-id or the default sort order. Each manifest records the spec its files were written with, and planning uses that spec. This is what lets the partition spec change without rewriting data (chapter 18).
Snapshots
A snapshot has a snapshot-id, a parent-snapshot-id, a sequence-number, a timestamp-ms, the manifest-list location and a summary map.[spec] The summary’s required operation says what kind of change it was:
append: only data files were added;replace: files were added and removed without changing table data, as in compaction;overwrite: a logical overwrite added and removed files;delete: files were removed, or delete files were added.
Some operations use operation to skip snapshots they don’t need to process; snapshot expiration is the spec’s example.
A snapshot’s data is spread over one or more manifests, for three reasons. Appends can add a new manifest instead of rewriting an old one (a fast append). Files written with different partition specs need different manifests (before v4). Large tables can be split so planning reads manifests in parallel.
Branches and tags. refs maps names to snapshots. A tag labels one snapshot. A branch moves as snapshots are committed to it, and main always exists and is the current snapshot. Refs carry retention settings that snapshot expiration honors.[spec]
Manifest lists
The manifest list is an Avro file of manifest_file rows:[spec]
| Field | Use |
|---|---|
manifest_path, manifest_length | Where the manifest is |
partition_spec_id | The spec its files were written with |
content | 0 = data, 1 = deletes (v2+) |
sequence_number, min_sequence_number | When the manifest was added; the lowest data sequence number of its live files |
added_snapshot_id | The snapshot that added it |
added_/existing_/deleted_files_count, …_rows_count | Entry counts by status |
partitions | One field_summary per partition field: contains_null, contains_nan, lower_bound, upper_bound |
A new manifest list is written for every commit attempt, because the set of manifests always changes. The Java writer puts the attempt number in the name (snap-<id>-<attempt>-<uuid>.avro).[src] The partitions summaries are the first pruning level. A manifest whose ts_day range is [2026-11-01, 2026-11-01] can’t contain a row with ts > 2026-11-03T06:00, so a scan never opens it.
Manifests
A manifest is an Avro file whose key-value metadata records the schema, the partition spec and its id, the format version and the content type. Its rows are manifest_entry structs:[spec][spec]
status: 0 EXISTING, 1 ADDED, 2 DELETED. “Deletes are informational only and not used in scans.”snapshot_id: the snapshot that added the file, or that deleted it if the status is 2.sequence_number(data sequence number) andfile_sequence_number(v2+).data_file: the file itself.
The data_file struct holds content (data, position deletes or equality deletes), file_path, file_format, the partition tuple, record_count, file_size_in_bytes, and statistics keyed by column id: column_sizes, value_counts, null_value_counts, nan_value_counts, lower_bounds and upper_bounds. It also has split_offsets (for example, row group offsets) and sort_order_id. A lower bound “must be less than or equal to all non-null, non-NaN values in the column for the file”, and an upper bound works the same way.
Status is per snapshot. In the snapshot that adds a file, its entry is ADDED. When a later commit rewrites that manifest, the entry is written as EXISTING. When a commit deletes the file, the rewritten manifest carries a DELETED entry stamped with the deleting snapshot. That entry lets that snapshot’s changes be read without diffing two trees.
A file must appear in at most one live entry across a snapshot’s manifests. Duplicates make behavior undefined, and writers aren’t required to check.[spec]
Q1. What does the catalog store for an Iceberg table, at minimum?
Q2. Why does every commit attempt write a new manifest list, even a retry of the same change?
Q3. A file was added in snapshot 5. In snapshot 7, a commit rewrites that manifest without deleting the file. What is the file's entry status in snapshot 7's manifest?
Q4. What does a scan do with a manifest entry whose status is DELETED?
Q5. A compaction rewrites 10 small files into one, without changing table data. What operation does its snapshot summary carry?
Sequence numbers and inheritance
Every successful commit gets a sequence number: the table’s last-sequence-number plus one. Data and delete files inherit the sequence number of the snapshot that added them, and v2 delete files use it to decide which data files are older (chapter 20).[spec]
The commit is optimistic, so the writer doesn’t know the final sequence number until the swap succeeds. A retry after a conflict gets a new one. To avoid rewriting manifests on every retry, Iceberg writes new entries with null in snapshot_id, sequence_number and file_sequence_number. At read time, nulls are filled from the manifest list row. Only the manifest list carries the real values, and it is rewritten on every attempt anyway.[spec]
The Java reader applies this in BaseInheritableMetadata.apply. A null snapshot id always inherits. Sequence numbers inherit only for ADDED entries, or when the manifest’s sequence number is 0 (v1):[src]
if (manifestEntry.snapshotId() == null) {
manifestEntry.setSnapshotId(snapshotId);
}
// in v2 tables, the data sequence number should be inherited iff the entry status is ADDED
if (manifestEntry.dataSequenceNumber() == null
&& (sequenceNumber == 0 || manifestEntry.status() == ManifestEntry.Status.ADDED)) {
manifestEntry.setDataSequenceNumber(sequenceNumber);
}
When an existing file is copied into a new manifest, as EXISTING or DELETED, its sequence numbers must be written explicitly. Otherwise it would wrongly inherit the new manifest’s number. The data sequence number is the age of the rows; the file sequence number is when this file was committed. They differ when a compaction rewrites old rows into a new file with the old data sequence number.
Q1. An ADDED entry has sequence_number = null. The manifest list row for its manifest has sequence_number = 12. What is the entry's data sequence number?
Q2. Why are new manifest entries written with a null sequence number?
Q3. Why must an EXISTING entry copied into a new manifest store its sequence numbers explicitly?
Try it
The explorer starts with four appends to an events table partitioned by day(ts). The tree shows the metadata file the catalog points to, the selected snapshot, its manifest list rows with partition summaries, and each manifest’s entries. A sequence number shown with ↑ was null in the file and inherited. Append a day to see a fast append add one manifest and reuse the rest. Delete a day to see one manifest rewritten with DELETED and EXISTING entries. Compact a day to see a replace snapshot. Then set a filter and see which manifests and files planning skips, or pick an older snapshot to time-travel. The engine is src/sim/iceberg/tree.ts.
Inclusive projection to the partition: ts_day >= 2026-11-03. Opens 2 of 4 manifests; scans 2 files.
metadata/00004-9ab58e43….metadata.jsonmetadata/snap-3051729680574597039-1-9a3cb8ab….avrometadata/9a3cb8ab…-m0.avro- ADDED
ts_day=2026-11-03/00004-4-9a790488.parquetseq 4↑ · id [26, 30] · ts [12:00, 18:00] → scan
metadata/9a3c99bc…-m0.avro- ADDED
ts_day=2026-11-03/00003-3-9a78e599.parquetseq 3↑ · id [21, 25] · ts [02:00, 08:00] → scan
metadata/9a3c7acd…-m0.avrometadata/9a3c5bde…-m0.avro- Created the table and committed four appends (day 3 twice).
Fast append, from the source. FastAppend.apply writes the new files into new manifests, adds any manifests the caller appended directly, and then adds every manifest of the parent snapshot unchanged:[src]
List<ManifestFile> newWrittenManifests = writeNewManifests();
manifests.addAll(newWrittenManifests);
// ... appended manifests ...
if (snapshot != null) {
manifests.addAll(snapshot.allManifests(ops().io()));
}
So an append costs one manifest, one manifest list and one metadata file, however big the table is. The price is many small manifests over time. That’s why Table.newAppend() returns a MergeAppend, and only newFastAppend() returns the class above.[src] MergeAppend merges manifests during the commit once there are enough of them: commit.manifest-merge.enabled defaults to true and commit.manifest.min-count-to-merge to 100.[src] The rewrite_manifests procedure compacts them on demand.
Scan planning
Planning turns a filter into a list of files. The spec describes it in terms of live entries, inclusive projections, and stats.[spec]
1. Inclusive projection. A filter on data columns becomes a filter on partition values through each manifest’s spec. It’s inclusive: “if a scan predicate matches a row, then the partition predicate must match that row’s partition”. With ts_day = day(ts), the filter ts > X projects to ts_day >= day(X). It must be >=, because the day of X itself can hold matching rows. A filter on a non-partition column projects to true.
2. Prune manifests. For each manifest, ManifestGroup builds a ManifestEvaluator from the projected filter and the manifest’s spec, and tests it against the partitions summaries. It also skips manifests with no ADDED or EXISTING files when deleted entries aren’t wanted.[src] For x < v, the evaluator rejects the manifest when the lower bound is >= v, or when every value is null:[src]
ByteBuffer lowerBound = stats.get(pos).lowerBound();
if (lowerBound == null) {
return ROWS_CANNOT_MATCH; // values are all null
}
T lower = Conversions.fromByteBuffer(ref.type(), lowerBound);
if (lit.comparator().compare(lower, lit.value()) >= 0) {
return ROWS_CANNOT_MATCH;
}
return ROWS_MIGHT_MATCH;
3. Prune files. Surviving manifests are read in parallel. ManifestReader keeps live entries whose partition tuple passes the projected filter and whose column stats pass an InclusiveMetricsEvaluator on the original filter. A file with record_count = 0 can’t match. A file whose id bounds are [11, 20] can’t contain id = 25.[src][src]
4. Residuals. Each remaining file becomes a scan task with a residual filter: what’s left of the predicate after the partition has been accounted for. Rows from the file are still filtered by it, because inclusive pruning can let through files with non-matching rows.
5. Delete files. Delete manifests are pruned the same way, and matching delete files are attached to the data files they apply to (chapter 20).
- load db.events → 00004-….metadata.json. The catalog stores one thing per table: the location of the current metadata file. Everything else is in files. Metastore Tables ↗
- read: schemas, specs, current-snapshot-id. Table metadata holds every schema, partition spec and sort order, and the list of snapshots. A time-travel read picks a different snapshot here. Table Metadata Fields ↗
- read the snapshot's manifest list. One row per manifest: its path, spec id, sequence number, file and row counts, and a summary (lower, upper, contains_null) per partition field. Manifest Lists ↗
- project: ts_day >= 2026-11-03. Inclusive projection through the manifest's partition spec: if a row matches the filter, its partition must match the projected filter. Scan Planning ↗
- prune manifests by summaries. ManifestEvaluator compares the projected filter with each manifest's partition bounds. Manifests with no ADDED or EXISTING files are skipped too. ManifestGroup.entries ↗
- read matching manifests (in parallel). Entries are read with inheritance: null snapshot ids and sequence numbers come from the manifest list row. InheritableMetadataFactory ↗
- keep live entries whose stats may match. DELETED entries are dropped. Each data_file is tested on its partition tuple and then its column bounds and counts (InclusiveMetricsEvaluator). ManifestReader.entries ↗
- read files; apply residual ts > …T06:00. The partition filter is inclusive, so files can still hold rows that fail the filter. The residual is evaluated on rows.
Count the remote calls. One to the catalog, one metadata file, one manifest list, then only the manifests that survive pruning, read in parallel. None of it depends on how many partitions exist or how long the history is. That is the “O(1) remote calls” goal. Compare Delta, where a cold reader lists _delta_log and replays from a checkpoint. Delta’s file stats live in the add actions, so they’re in memory once the snapshot is built.
Time travel is the same walk from a different snapshot: pick one by id, by timestamp (via snapshot-log), or by ref.[spec]
Q1. A table is partitioned by ts_day = day(ts). What is the inclusive projection of ts > '2026-11-03T06:00'?
Q2. A manifest's partition summary for ts_day is lower 2026-11-01, upper 2026-11-02. The projected filter is ts_day >= 2026-11-03. What happens?
Q3. Filter id = 25, where id is not a partition column. Which files can planning skip? (select all that apply)
Q4. Why does each scan task still carry a residual filter?
Q5. How does an Iceberg reader time-travel to an older snapshot?
Format versions
| Version | Adds |
|---|---|
| 1 | Analytic tables over immutable Parquet, Avro and ORC files: the whole tree above |
| 2 | Row-level deletes (position and equality delete files), sequence numbers, delete manifests, and stricter writer rules; manifest-list becomes required |
| 3 | Deletion vectors, row lineage (_row_id, next-row-id, first_row_id), default values, new types (nanosecond timestamps, variant, geometry, geography, unknown), multi-argument transforms, encryption keys |
All v1 files stay valid after upgrading to v2, and Appendix E says how to read v1 metadata with v2 defaults: for example, sequence numbers default to 0.[spec][spec]
Q1. What did format version 2 add? (select all that apply)
Q2. Which are in format version 3? (select all that apply)
Q3. In the v4 draft, what replaces the manifest list?
Iceberg and Delta side by side
| Delta | Iceberg | |
|---|---|---|
| Current state | Replay _delta_log from a checkpoint | Walk metadata → manifest list → manifests |
| Commit point | PUT-if-absent of <v>.json (or the catalog, chapter 14) | Catalog swap of the metadata pointer |
| Per-file stats | JSON stats in each add | Typed lower_bounds/upper_bounds maps in manifests |
| Partition pruning | Partition values in each add | Partition summaries per manifest, then per file |
| Schema and partition evolution | Column mapping (chapter 15) | Column ids and spec ids from the start |
| History of a change | The commit’s actions | ADDED and DELETED entries in rewritten manifests |
History
Iceberg was started at Netflix in 2017 by Ryan Blue and Dan Weeks; the original repository is still at Netflix/iceberg.[repo] It entered the Apache Incubator in November 2018 and became a top-level Apache project in May 2020.[ASF] In June 2024 Databricks agreed to acquire Tabular, the company founded by Iceberg’s original creators.[press]
Summary
- The catalog points to a metadata file. The metadata file lists snapshots. Each snapshot points to a manifest list, which lists manifests, which list data and delete files with partition tuples and column stats.
- Every commit writes new files bottom-up and swaps the pointer atomically. A fast append writes one manifest and reuses all the parent’s manifests.
- Entries are ADDED, EXISTING or DELETED. DELETED entries record a snapshot’s changes and are never scanned.
- New entries are written with null snapshot ids and sequence numbers, and inherit them from the manifest list, so retries rewrite only the manifest list.
- Planning projects the filter inclusively onto each manifest’s partition spec, prunes manifests by partition summaries, prunes files by partition and column bounds, and leaves a residual for rows.
- v2 added row-level deletes and sequence numbers, and v3 added deletion vectors and row lineage. v4, still a draft, replaces the manifest list with a root manifest.
Concepts in this chapter
Explained here
Primary sources
Review this chapter
This chapter has 18 quiz questions.