bharadwaj-pendyala commented on issue #11942:
URL: https://github.com/apache/arrow-rs/issues/11942#issuecomment-6526216074
I reproduced this on main (9ffd63d52) with your struct example. It prints
`{"a":{"metadata":"AQAA","value":"FAEAAAA="}}`.
My fix would add a `Variant` row builder. It wraps the child in
`VariantArray::try_new`, appends null for null rows, and uses
`try_value(index)` otherwise, including for shredded `typed_value`. Next to
`make_arrow_to_variant_row_builder`, a helper would pick it when the child
`Field` passes `has_valid_extension_type::<VariantType>()`. Otherwise it uses
the existing `DataType` dispatch. The struct, list-like, map, union and run-end
builders already have the child `Field`, so they can use it. Unannotated
structs with `metadata`/`value` columns stay ordinary objects.
Dictionary values don't carry a field, so they'd stay as they are. The
public `cast_to_variant(&dyn Array)` signature doesn't change either. A
top-level annotated input is the field-aware entry point from #11937, and I'd
keep that out of this PR.
Am I missing a case here?
--
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]