jorgecarleitao opened a new pull request #8985:
URL: https://github.com/apache/arrow/pull/8985


   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.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to