alamb opened a new issue, #1542: URL: https://github.com/apache/arrow-rs/issues/1542
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** Often rust code calculates some indices and then calls the take kernel: https://docs.rs/arrow/11.1.0/arrow/compute/kernels/take/fn.take.html However, it is necessary to create an Array (aka buffer all the indexes) which is both not necessary time wise as well as memory inefficient here are some examples of creating an Array from an iterator simply to call the `take` kernel in DataFusion: https://github.com/apache/arrow-datafusion/blob/fa9e0164127c233a16b53e1d12f162f3b00171f5/ballista/rust/core/src/execution_plans/shuffle_writer.rs#L233-L244 https://github.com/apache/arrow-datafusion/blob/9e3bec811549b61bcb7957554879b77fd9c249ef/datafusion/physical-expr/src/physical_expr.rs#L57-L63 **Describe the solution you'd like** I would like a `take` kernel that takes an iterator of optional indices, perhaps something like: ```rust fn take_iter( values: &dyn Array, iter: impl IntoIterator<Item=Option<usize>>, options: Option<TakeOptions>, ) -> Result<ArrayRef> { ... } ``` Which would act the same as the following, but would not instantiate the intermediate `indicies` array ```rust let indices: UInt64Array = iter.into_iter().collect(); take(values, &indices, options) ``` Bonus points for an API that can take iterators of `Option<usize>`, `usize`, `Option<i32>`, `i32`, etc (aka anything that can be turned into an Option<usize>). **Describe alternatives you've considered** N/A **Additional context** Add any other context or screenshots about the feature request here. -- 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]
