Replies: 5 comments 5 replies
-
Correct me if I'm wrong, but (especially within Rust!), I would assume that the majority of use cases would consist of dealing with non-nullable data. This way, would it perhaps make sense to have two APIs for iteration? (just thinking out loud)
Not sure how to wrap this nicely, but (ignoring potential API breakage for a second etc, just hypothesizing), it could even be something like .iter()?
.iter_nullable() What's not so nice is the fallability of instantiating non-optional iteration because you don't know in advance if there's a bitmask or not? But don't think there's ways around it. |
Beta Was this translation helpful? Give feedback.
-
Most arrays have non-optional iterators, |
Beta Was this translation helpful? Give feedback.
-
Thanks @jorgecarleitao that's perfect, had missed that. Great addition! |
Beta Was this translation helpful? Give feedback.
-
@jorgecarleitao I'm using I can think of two possible solutions, but both need changes to arrow2:
Do either of these sound reasonable? Please lmk if you have any other ideas. |
Beta Was this translation helpful? Give feedback.
-
@jorgecarleitao If you think any of the above suggestions would be reasonable additions, would be always glad to help with a PR. |
Beta Was this translation helpful? Give feedback.
-
Hey @jorgecarleitao, for arrow2_convert, we're considering an API simplification which would be possible if we can have iterators on non-optional elements. If an arrow2::array has no optional elements and doesn't need a valid bitmask, then the array would map straightforwardly to the rust equivalent of
Vec<T>
(as opposed toVec<Option<T>>
).I was wondering if you think there are any downsides to non-optional iterators in general, and if not whether that abstraction would belong in arrow2 or arrow2_convert. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions