sdf-jkl opened a new pull request, #10015: URL: https://github.com/apache/arrow-rs/pull/10015
# Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - Closes #NNN. # Rationale for this change Shredding into `FixedSizeBinary(16)` means we're shredding into `UUID` Parquet logical type. `shred_variant` currently doesn't preserve extension type metadata for the typed value field. UUID is the only valid `Variant` shredding type that requires an arrow extension type. https://github.com/apache/parquet-format/blob/master/VariantShredding.md Earlier in [#](https://github.com/apache/arrow-rs/issues/8665#issuecomment-3423325006) @scovich mentioned: > Yeah, as long as `shred_variant` only takes a `DataType` instead of a `Field`, we are forced to assume 16-byte fixed binary is UUID. If it accepted a `Field`, we should additionally require the UUID extension type. Otherwise, we potentially run into problems because Decimal128 can _also_ use 16-byte fixed binary! This is an argument proposing to use `Field` instead of `DataType` for `as_type` parameter in `shred_variant`. This should not be an issue because arrow has a `Decimal128Type` to represent `Decimal128` logical Parquet type. This way there's no ambiguity in using `FixedSizeBinary(16)` arrow type to represent `UUID`. Switching `as_type` to `Field` is unnecessary. <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> # What changes are included in this PR? - `VariantArray::from_parts/ShreddedVariantFieldArray::from_parts` now add `UUID` extension type metadata to the typed_value `Field` if `DataType` is `FixedSizeBinary(16)` - Uncommented `UUID` extension part metadata validation in a unit test. <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> # Are these changes tested? - Yes, unit test. <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? If this PR claims a performance improvement, please include evidence such as benchmark results. --> # Are there any user-facing changes? - Shredded `UUID` typed value fields now preserve `UUID` extension type metadata. <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
