Skip to content

[iceberg] Allow publishing VARIANT columns with Iceberg format version 3 - #9246

Open
vbabenkoru wants to merge 1 commit into
apache:masterfrom
vbabenkoru:iceberg-v3-variant
Open

[iceberg] Allow publishing VARIANT columns with Iceberg format version 3#9246
vbabenkoru wants to merge 1 commit into
apache:masterfrom
vbabenkoru:iceberg-v3-variant

Conversation

@vbabenkoru

Copy link
Copy Markdown
Contributor

Final PR of the 3-PR stack for #8972closes #8972. Stacked on #9244 and #9245: only the top commit belongs to this PR; the 13 commits below it are the two PRs underneath and will disappear from the diff as they merge.

Purpose

Iceberg supports the VARIANT type from format version 3 onward, but v3 also made row lineage mandatory. Paimon therefore rejected VARIANT columns in the Iceberg compatibility layer for all format versions, because the v3 metadata it produced was not lineage-compliant and GA readers would reject the whole table (#8972).

With #9244 and #9245, Paimon's v3 writer emits complete row lineage (table metadata, manifest lists, manifest entries), so the reason to block VARIANT on v3 is gone. This PR lifts the guard for metadata.iceberg.format-version >= 3:

  • Tables with VARIANT columns publish Iceberg metadata when the format version is 3, mapping to the Iceberg variant type.
  • Format version 2 keeps the existing clear rejection (with a message pointing at the format-version option), since VARIANT does not exist in v2.

The guard lift is intentionally the last commit of the stack: every v3 table that can publish VARIANT is guaranteed to have carried full row lineage from its first commit.

Tests

  • IcebergRowLineageCompatibilityTest#testVariantPublishableWithFormatVersion3: a VARIANT column publishes on v3, the schema maps to Iceberg variant, and lineage fields are present.
  • IcebergRowLineageCompatibilityTest#testVariantRejectedWithFormatVersion2: v2 commits with VARIANT still fail with the explicit error.

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.

@vbabenkoru
vbabenkoru force-pushed the iceberg-v3-variant branch 5 times, most recently from ce39155 to c495046 Compare August 18, 2026 21:50
@JingsongLi
JingsongLi marked this pull request as draft August 20, 2026 01:53
@vbabenkoru
vbabenkoru marked this pull request as ready for review August 21, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][iceberg] REST commit fails on format-version 3: Cannot parse missing long: next-row-id

1 participant