[iceberg] Assign manifest-level row lineage for Iceberg format version 3 - #9245
Open
vbabenkoru wants to merge 14 commits into
Open
[iceberg] Assign manifest-level row lineage for Iceberg format version 3#9245vbabenkoru wants to merge 14 commits into
vbabenkoru wants to merge 14 commits into
Conversation
Adds tests only, per the follow-up to the Layer 2 verification sweep (task-7-report.md gap summary): compactMetadataIfNeeded's explicit-142 passthrough branch and its v3 merge call site now have coverage; the REST recreation-consistency test compares first-row-id values against the local file-based mirror instead of only checking non-nullity; a GA-reader test resolves actual per-file first_row_id values (with the iceberg-data generics limitation verified and documented); and the v2 manifest-list shape (14 columns, no first_row_id) is now pinned by a byte-level regression test. No production code changes; all behavior matched the spec exactly.
Assigning first_row_id to a carried-over v3 manifest re-lists the same physical avro file with a different list-level field. expireManifestList compared IcebergManifestFileMeta values, so expiring the pre-assignment manifest list deleted the shared file while newer manifest lists still referenced it, breaking every subsequent Iceberg read of the retained snapshots. Decide liveness by manifest path instead, and cover the upgrade boundary with an expiration regression test.
…rg-ga profile
Iceberg 1.10+ ships Java-17 bytecode, so bumping paimon-iceberg to 1.11
outright broke the JDK 11 CI workflows that build this module. Restore
the 1.8.1 default so the module compiles and tests on JDK 11: the few
assertions that need the GA reader API (per-manifest / per-file
firstRowId) resolve it reflectively and skip themselves when absent, the
pre-GA enableRowLineage opt-in in IcebergMetadataTest is called
reflectively so the test passes on both lines, and the update logging in
the REST committer no longer names the RemoveSnapshot(s) class that was
renamed between the two lines. The full GA validation - Iceberg 1.11
with the Hadoop/Jetty/Jackson pins its REST test fixtures need - moves
behind the opt-in iceberg-ga profile (JDK 17):
mvn test -pl paimon-iceberg -Ppaimon-iceberg,iceberg-ga
Verified: default suite on JDK 11 (50 tests, 2 GA-only skips) and
-Piceberg-ga on JDK 17 (50 tests, no skips).
Author
|
The JDK 11 CI failures were caused by this PR bumping I've restructured the PR to keep CI green without losing the GA validation:
Longer term, actually bumping the module's Iceberg dependency (and giving it a JDK 17 CI job) is a project-level decision — 1.8.1 predates GA row lineage, and Iceberg's active line has moved to Java 17. Happy to file that separately or adjust here, whichever the maintainers prefer. |
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.
Second PR of the 3-PR stack for #8972, stacked on #9244: GitHub cannot target a fork branch as base, so this PR shows the full 13-commit diff against master — only the top 9 commits belong to this PR; the first 4 are #9244 and will disappear from the diff once it merges and this branch is rebased. Verified in both configurations: default on JDK 11 (50 tests, 2 GA-only skips) and
-Piceberg-gaon JDK 17 (50 tests, no skips). The VARIANT enablement PR sits on top of this one.Purpose
#9244 made v3 table metadata carry row lineage. The Iceberg v3 spec also requires lineage at the manifest level:
first_row_idin the manifest list (field 520) and in data-file entries (field 142), with defined inheritance — an ADDED entry with nullfirst_row_idinherits from the manifest, and the inherited value must be materialized when an entry is rewritten as EXISTING/DELETED. Without these fields, GA readers cannot expose stable_row_idvalues, and row IDs silently change across snapshots.This PR completes writer-side v3 compliance with stable, synthetic row IDs:
first_row_id(field 520); manifest entries gainfirst_row_idon the data file (field 142). Both are written only for format version 3; v2 file shapes are unchanged (pinned by tests).first_row_idreceives one from the table'snext-row-idwatermark, which advances by the rows that actually inherit an ID. DELETE manifests are never assigned, per spec.first_row_idget the value materialized into the rewritten file, so IDs stay stable across rewrites.added-rows/next-row-idnever double-assign a row-id range.first_row_idto a carried-over manifest re-lists the same file with a different list-level field; the old equality check deleted the shared file while newer snapshots still referenced it.iceberg-gaprofile (mvn test -pl paimon-iceberg -Ppaimon-iceberg,iceberg-gaon JDK 17) runs the identical suite against Iceberg 1.11, validating compliance with the reference implementation.iceberg-coreremains provided-scope; the runtime classpath still decides the deployed Iceberg version.Known follow-up (performance, not correctness): computing the true inheriting row count re-reads manifests that were rewritten in the same commit; this can be folded into the manifest write itself later.
Tests
IcebergRowLineageCompatibilityTestgrows from 5 to 17 cases, including:bucket = 2) assignment is stable across snapshots — IDs never shift when unrelated buckets commit;added-rowscounts inherited legacy rows;first_row_idper data file;IcebergRestMetadataCommitterTestcovers v3 registration and recreation against a REST catalog with value-equality checks vs the local metadata.AI notice
The code is generated using Fable 5 (with reviews from Codex) but has been verified to run on a real cluster with Flink, Paimon, Iceberg, StarRocks and Snowflake.