Repository navigation
Conversation
validate_partition_name returned early when the partition name was not also a schema column, so its empty-name and uniqueness checks only ran for names that matched a column. update_spec could then commit a spec with two fields of the same name (for example through rename_field), after which appends failed and Java cannot load the metadata. create_table did not check uniqueness at all because it passed a fresh set for every field. Run the empty-name and uniqueness checks first, and track the names seen so far in assign_fresh_partition_spec_ids.
ebyhr
reviewed
Nov 9, 2026
This branch has not been deployed
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.
Closes #4304
Rationale for this change
validate_partition_namereturned early when the partition name was not also a schema column, so its empty-name and uniqueness checks only ran for names that matched a column.update_speccould then commit a spec with two fields of the same name (for example throughrename_field), andcreate_tabledid not check uniqueness at all becauseassign_fresh_partition_spec_idspassed a fresh set of names for every field.This runs the empty-name and uniqueness checks first, and tracks the names seen so far in
assign_fresh_partition_spec_ids.Are these changes tested?
Yes:
test_update_spec_rejects_duplicate_partition_nameintests/table/test_init.py: renaming a field to an existing name, adding a field with a name that is being renamed away, and an empty name now raise.test_new_table_metadata_with_duplicate_partition_name_failsintests/table/test_metadata.py: new table metadata with two partition fields of the same name now raises.Both fail on
mainand pass with this change.tests/tableandtests/test_schema.py: 890 passed.ruff checkandruff format --check(0.14.3) pass on the changed files.Are there any user-facing changes?
Partition specs with duplicate field names, which were accepted before, now raise
ValueError: Partition name has to be unique: <name>.