Commits


Jorge C. Leitao authored and Andrew Lamb committed 1d874fa2024
ARROW-11005: [Rust] Remove indirection from `take` kernel This PR is a small cleanup of the `take` kernel. 1. replaces `&Arc<Array>` by `&Array`. This is a small change in the API, but makes it more obvious that the only requirements for `take` is implementing the trait `Array`. 2. internal concrete implementations of `take` are no longer `dyn`, and instead expect the corresponding array types and return the corresponding array types. 3. Clarified in the documentation that not performing bound checks can lead to undefined behavior. 4. Added equality for `FixedSizeListArray`, that was missing. The rational for this PR is that it makes it more obvious the design of the module: each array type has its own implementation (e.g. `take_primitive<T>(array: &PrimitiveArray<T>, indices: ...) -> PrimitiveArray<T>`), and there is one `dyn` implementation, `take(array: &Array, indices: ...) -> ArrayRef`, that uses each type-specific implementation and wraps it on an `Arc<Array>` for the `dyn` behavior. This is mostly for simplicity and readability, but we could expose these methods publicly. Closes #8985 from jorgecarleitao/simpler_take Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>