[iceberg] Reject schemas the Iceberg mirror cannot represent before the commit - #9199
Draft
plusplusjiajia wants to merge 1 commit into
Draft
[iceberg] Reject schemas the Iceberg mirror cannot represent before the commit#9199plusplusjiajia wants to merge 1 commit into
plusplusjiajia wants to merge 1 commit into
Conversation
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.
Purpose
Some Paimon schemas cannot be represented in the Iceberg metadata this layer emits, and today the mismatch surfaces only after the Paimon snapshot is published: the mirror then publishes metadata Iceberg misreads, or fails on every retry and leaves the manifests it wrote behind. This PR checks before the commit and vetoes it there.
Rejected: nanosecond-precision timestamps on any format version (Paimon writes precision > 6 as Parquet INT96, which Iceberg cannot read back as timestamp_ns), VARIANT on a v2 table, VARIANT partition keys, and manifest.legacy-version on v3. The check runs as a pre-commit callback, so the Paimon snapshot is never published, and the manifests written during preparation are cleaned up exactly like a preparation failure.
Only the schemas a commit newly publishes are gated, so a veto is never permanent: already mirrored schemas stay valid, a schema vetoed at its introduction and since remedied (e.g. the column was dropped) is skipped at emission — with the snapshot entry falling back to the current schema id so no pointer dangles — and a transient read failure is rethrown instead of silently dropping a valid schema.