codewarnab commented on issue #11937:
URL: https://github.com/apache/arrow-rs/issues/11937#issuecomment-6557176584

   Before I start, would these two new functions work?
   
   ```rust
   cast_to_variant_with_field(input, field)
   cast_to_variant_with_field_and_options(input, field, options)
   ```
   
   They would accept the input `Field` along with the array, so the conversion 
can read the UUID annotation.
   
   - A valid `arrow.uuid` field becomes `Variant::Uuid`.
   - Ordinary `FixedSizeBinary(16)` stays `Variant::Binary`.
   - UUID fields inside lists, structs, and map values are handled too.
   - Null handling stays the same.
   - A field that does not match the array, or has an invalid UUID annotation, 
returns an error.
   
   The existing functions would stay unchanged. The first new function would 
use the same defaults as `cast_to_variant`.
   
   Does this look okay, or would you prefer a different API?
   


-- 
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]

Reply via email to