Skip to content

fix(spec): allow void partition fields whose source column was dropped - #3568

Open
ninglinLiu wants to merge 2 commits into
apache:mainfrom
ninglinLiu:fix/3555-void-default-spec-bind
Open

ninglinLiu wants to merge 2 commits into
apache:mainfrom
ninglinLiu:fix/3555-void-default-spec-bind

Conversation

@ninglinLiu

Copy link
Copy Markdown
Contributor

Purpose

Fixes #3555.

TableMetadataBuilder::build() rebinds the default partition spec with bind(). That path required every partition source column to still exist, including for Transform::Void. Java's PartitionSpec.checkCompatibility skips void fields, so a v1 replace that turns a removed partition field into void and then drops the source column succeeds in Java and failed here.

Changes

  • Skip the source-existence / type check for void fields in check_transform_compatibility
  • Add bind + builder tests for a void field whose source id is no longer in the schema

Tests

cargo test -p iceberg --lib void_field_whose_source
cargo test -p iceberg --lib default_void_spec_after_source

AI Disclosure

AI-assisted implementation; I reviewed the change against Java's checkCompatibility behavior and verified the new tests locally.

`TableMetadataBuilder::build` rebinds the default partition spec with
`bind()`, which previously required every source column to exist. Java's
`PartitionSpec.checkCompatibility` skips void fields, so a v1 replace
that turns a removed partition into void then drops the column succeeds
there and failed here.

Skip the source-existence check for `Transform::Void` and cover both
bind and the builder rebuild path.

Fixes apache#3555
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Nov 28, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TableMetadataBuilder::build() rejects a default spec with a void field whose source column was dropped

1 participant