Repository navigation
feat: Iceberg v3 tables, with row lineage - #148
Merged
Merged
Conversation
hasyimibhar
marked this pull request as draft
November 16, 2026 18:09
hasyimibhar
force-pushed
the
feat/iceberg-v3
branch
from
November 16, 2026 18:58
1c84ffe to
b3577e6
Compare
`sink.format_version: 3` (or `PG2ICEBERG_FORMAT_VERSION=3`) creates new tables as v3; v2 stays the default, and existing tables keep theirs. Tables behave as v2 does — equality deletes — with v3's row lineage held on every commit: - Compaction writes `_row_id` and `_last_updated_sequence_number` into its outputs once any live data file has a `first_row_id`: the stored value, or the inherited one (`first_row_id` + position; the file's data sequence number). Moved rows keep both. - A table another engine upgrades to v3 with data in it gets ids on its next commit; a pass planned before then would give its rows new ones, so its commit fails as a conflict (`stores_row_lineage`, the fork's `validate_no_row_ids`) and it plans again. - `IcebergRustCatalog::snapshots()` reports each data file's `first_row_id` from the latest manifest list naming it. The fork (polynya-dev/iceberg-rust#6) inherits `first_row_id` on manifest read (upstream #2922), sends `format-version` on REST create — iceberg-rust's REST client ignored the format version, so tables always got the server's default — and adds `validate_no_row_ids`. DST: a format dimension (v2, v3, v3 by upgrade), a sim catalog that assigns row ids, invariants for row lineage (every live row has ids, unique, below next-row-id) and for commits that move rows keeping them, pinned cases on the sim and iceberg-rust, and a focused proptest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hasyimibhar
force-pushed
the
feat/iceberg-v3
branch
from
November 16, 2026 19:14
b3577e6 to
8a9e5fa
Compare
hasyimibhar
marked this pull request as ready for review
November 16, 2026 19:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pg2iceberg can now create v3 tables, and row lineage holds on every commit it makes. Tables still behave as v2 does: equality deletes, no deletion vectors.
sink.format_version: 3(orPG2ICEBERG_FORMAT_VERSION=3) creates new tables as v3. v2 stays the default, and existing tables keep their version. Anything other than 2 or 3 is refused at config load.first_row_id, a pass's outputs store each row's_row_idand_last_updated_sequence_numberexplicitly. The stored value is kept if there is one; otherwise the inherited one is written (first_row_id+ position, and the file's data sequence number). Moved rows keep both, as v3 requires.PreparedCompaction::stores_row_lineageand the fork'sRewriteFilesAction::validate_no_row_ids.IcebergRustCatalog::snapshots()reports each data file'sfirst_row_idas the latest manifest list naming it, so the FileIndex and compaction see what readers do.first_row_idinheritance on manifest read (upstream #2922).polynya-patches-v0.11.0; the lockfile moves to it) adds two things:format-version. iceberg-rust's REST client ignores the format version, 0.11.0's too, so tables always got the server's default, including the "explicit v2" pg2iceberg asked for.validate_no_row_ids.