scovich opened a new issue, #8319:
URL: https://github.com/apache/arrow-rs/issues/8319

   **Describe the bug**
   
   arrow-rs normally has a 1:1 relationship between data types and array types, 
in order to allow downcasting from `&dyn Array` or `ArrayRef`. But 
`VariantArray` breaks that convention by declaring it is a `StructType`. 
   
   **To Reproduce**
   
   A match of the form:
   ```rust
   match array.data_type() {
         ...
       StructType(_) => array.as_struct().do_something(), // panics!
         ...
   }
   ```
   
   **Expected behavior**
   
   Somehow we need a safe way to distinguish a VariantArray from a normal 
StructArray. Not just to protect hapless uses, but also to make our own code 
safe (`cast_to_variant` would both panic if passed a `VariantArray` today).
   
   **Additional context**
   
   Discovered during pathfinding work for variant shredding and a potential 
extension type for variant.


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