Skip to content

[tiering][iceberg] Validate partition spec before lake tiering#3639

Merged
fresh-borzoni merged 5 commits into
apache:mainfrom
litiliu:codex/iceberg-validate-partition-spec
Jul 16, 2026
Merged

[tiering][iceberg] Validate partition spec before lake tiering#3639
fresh-borzoni merged 5 commits into
apache:mainfrom
litiliu:codex/iceberg-validate-partition-spec

Conversation

@litiliu

@litiliu litiliu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3638

Iceberg lake tiering constructs partition keys from the current Iceberg partition spec, but fills them with partition and bucket values produced according to the Fluss table metadata. If an external client evolves the Iceberg partition spec, a newly created writer can silently attach incorrect partition metadata to data files.

This change validates the current Iceberg partition spec before the tiering writer is created and fails fast when the source columns, field order, transforms, or transform parameters are incompatible with the Fluss table.

Brief change log

  • Extract the Fluss-to-Iceberg partition-spec construction into a shared internal utility used by both automatic Iceberg table creation and writer validation.
  • Add a partition-spec validator that compares the expected and current Iceberg specs by field order, source field ID, and transform, including parameters such as bucket count.
  • Run the validation before creating the Iceberg task writer and throw a descriptive, non-retriable InvalidTableException on mismatch.
  • Add regression coverage for an externally evolved bucket transform and align the existing tiering test metadata with the tested table definitions.

Tests

  • mvn -pl fluss-lake/fluss-lake-iceberg verify
    • 108 unit tests passed.
    • 28 integration tests passed.

API and Format

No public API or storage-format changes. The shared partition-spec utility is marked @Internal, and the existing Iceberg table mapping remains unchanged.

Documentation

No documentation changes. This is a correctness fix with no new user-facing configuration.

Generative AI disclosure

Yes. Generated with OpenAI Codex and reviewed by the human developer.

@litiliu
litiliu force-pushed the codex/iceberg-validate-partition-spec branch 2 times, most recently from ce6eb53 to 89238ca Compare July 13, 2026 09:46
@litiliu
litiliu marked this pull request as ready for review July 13, 2026 09:53
@litiliu

litiliu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@fresh-borzoni Would you mind taking a look at this PR when you have time? Thanks.

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litiliu Thank you for the PR, left some questions, PTAL

@litiliu
litiliu force-pushed the codex/iceberg-validate-partition-spec branch from 89238ca to 7339626 Compare July 15, 2026 07:18

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litiliu Thank you, looks good, let's close one hole left and good to merge

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litiliu Thank you, LGTM 👍

@fresh-borzoni
fresh-borzoni merged commit 8a51f21 into apache:main Jul 16, 2026
17 checks passed
@litiliu
litiliu deleted the codex/iceberg-validate-partition-spec branch July 17, 2026 02:23
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.

[tiering][iceberg] Validate partition spec before lake tiering

2 participants