scovich commented on code in PR #10015:
URL: https://github.com/apache/arrow-rs/pull/10015#discussion_r3357383204
##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -868,6 +868,20 @@ impl TryFrom<&StructArray> for ShreddingState {
}
}
+/// Build the `typed_value` [`FieldRef`] for a shredded column.
+///
+/// The Variant spec maps `FixedSizeBinary(16)` exclusively to UUID, so any
+/// shredded column of that type must carry the canonical [`UuidExtension`]
+/// extension metadata on its field.
+fn typed_value_field(array: &ArrayRef) -> FieldRef {
+ let field = Field::new("typed_value", array.data_type().clone(), true);
+ let field = match array.data_type() {
+ DataType::FixedSizeBinary(16) =>
field.with_extension_type(UuidExtension),
+ _ => field,
+ };
Review Comment:
nit
```suggestion
let mut field = Field::new("typed_value", array.data_type().clone(),
true);
if array.data_type() == DataType::FixedSizeBinary(16) {
field = field.with_extension_type(UuidExtension);
}
```
--
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]