Repository navigation
Conversation
…t them In v1 the partition field ids were not tracked and were assigned sequentially from 1000 in each spec. A v1 partition spec whose fields have no field-id failed to parse, with a TypeError for two or more fields.
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.
Rationale for this change
In v1 table metadata the partition field ids were not tracked: the spec says they were "assigned sequentially in each spec starting at 1,000". A v1
partition-spec(orpartition-specsentry) whose fields have nofield-idcurrently fails to parse: a pydantic "Field required" error for one field, andTypeError: '>' not supported between instances of 'NoneType' and 'NoneType'for two or more, raised while computinglast-partition-id.TableMetadataV1.construct_partition_specsnow assigns 1000, 1001, ... within each spec when none of its fields has an id, before computinglast-partition-id. A spec that mixes fields with and without ids is rejected with Java's message ("Cannot parse spec with missing field IDs"), as inPartitionSpecParser.Are these changes tested?
Yes,
test_v1_partition_fields_without_field_idin tests/table/test_metadata.py (fails on main, passes here). Also ran tests/table, tests/test_serializers.py, tests/catalog/test_base.py and tests/catalog/test_sql.py.Are there any user-facing changes?
Old v1 tables written without partition field ids can now be loaded.