samuelcolvin commented on code in PR #6218:
URL: https://github.com/apache/arrow-rs/pull/6218#discussion_r1711387982
##########
arrow-array/src/array/union_array.rs:
##########
@@ -241,6 +241,27 @@ impl UnionArray {
boxed.as_ref().expect("invalid type id")
}
+ /// Get a member of the union as an array, this is equivalent to
[`self::child`] for sparse unions.
+ ///
+ /// # Panics
+ /// Panics if `type_id` is not present in the union.
+ pub fn member_array(&self, type_id: i8) -> &ArrayRef {
+ let child = self.child(type_id);
+ match &self.offsets {
+ Some(_offsets) => {
+ todo!("I'm not sure what to do here");
Review Comment:
@alamb I couldn't work out how to do this since we don't know the type of
`child` here so we can't downcast.
Any help much appreciate.
--
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]