apache / arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
https://arrow.apache.org/
Apache License 2.0
14.46k stars 3.52k forks source link

[Rust] Introduce safe and performant iterators over elements of arrays #26825

Open asfimport opened 3 years ago

asfimport commented 3 years ago

The value functions in the primitive / string / etc arrays are often used to get elements at i in a loop.  Some of them don't have boundary checks for performance reasons, so usage of them is unsafe.

We should introduce a safe iterator over the elements (T instead of Option) that doesn't do boundary checks and can be used to iterate over the elements of the array. Maybe values_iter would be a good name?

Reporter: Daniël Heres / @Dandandan

Note: This issue was originally created as ARROW-10892. Please see the migration documentation for further details.

asfimport commented 3 years ago

Andrew Lamb / @alamb: Related discussion: https://github.com/apache/arrow/pull/8900#discussion_r541727214