Skip to content

Conversation

@scovich
Copy link
Contributor

@scovich scovich commented Jan 26, 2026

Which issue does this PR close?

Rationale for this change

The logic to instantiate a type extension does not really depend on Field, other than indirectly because that struct happens to contain all the necessary bits of information.

As part of the work to make the JSON decoder support extension types, it was observed that a field is not always available (or at least, not desirable because it creates redundancy). This change addresses the concern by making it possible to work directly with extension types instead of being forced to route through a Field instance.

What changes are included in this PR?

Factor out the body of Field::try_extension_type as a new associated function ExtensionType::try_new_from_field_metadata that takes data type and field metadata map and delegates to ExtensionType::try_new. Field::try_extension_type then simply calls that new method.

Are these changes tested?

Code movement. Existing unit tests validate it.

Are there any user-facing changes?

New provided trait method.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 26, 2026
@github-actions github-actions bot added the parquet Changes to the parquet crate label Jan 26, 2026
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @scovich -- this makes sense to me

@scovich
Copy link
Contributor Author

scovich commented Jan 27, 2026

@alamb -- any reason this shouldn't merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants