Skip to content

feat(inspect): unify and project metadata partition values - #1134

Draft
manuzhang wants to merge 5 commits into
apache:mainfrom
manuzhang:codex/metadata-partition-values-20261115
Draft

manuzhang wants to merge 5 commits into
apache:mainfrom
manuzhang:codex/metadata-partition-values-20261115

Conversation

@manuzhang

@manuzhang manuzhang commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Why

Metadata tables expose a single partition struct even when files were written with different partition specs. As specs evolve, fields can be added or renamed, and the same name can refer to different field IDs. Metadata tables need a consistent schema and a way to place each file’s partition values in the correct fields.

What

  • Build a table-wide partition struct by field ID. Use the newest name for each field, disambiguate names reused by different IDs, retain compatible non-void transforms, and reject conflicting definitions.
  • Project each spec’s values into that struct by field ID. Preserve nulls, fill missing fields with nulls, and promote primitive values to the target type.
  • Add helpers to append literals and projected partition values to Arrow builders. Tests cover spec evolution, name reuse, type promotion, conflicting field IDs, incorrect value counts, and null serialization.

Pre-commit and all 86 metadata tests passed on c7ba91f3. Earlier validation also passed 58 metadata tests and the C++20 compatibility check in a standalone static Debug build, clang-tidy 22.1.8, and partition tests in the combined shared-library build. The full set of split changes passed 144 tests with one expected format-version skip.

Copilot AI balanced review requested due to automatic review settings November 15, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Extract a focused piece from the metadata table implementation with its tests.

Co-authored-by: Codex <[email protected]>
@manuzhang
manuzhang force-pushed the codex/metadata-partition-values-20261115 branch from 75d594e to 76a25d0 Compare November 25, 2026 10:25
Keep distinct historical field IDs without exposing duplicate names that break named metadata projections. Reserve existing names before generating field-ID suffixes, following the approach proposed in apache/iceberg#18243.

Co-authored-by: Codex <[email protected]>

This branch has not been deployed

No deployments
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.

2 participants