ypomortsev opened a new issue, #54920: URL: https://github.com/apache/arrow/issues/54920
### Describe the enhancement requested The compute functions `inverse_permutation` and `scatter` accept arrays of indices that are can only be be signed integers. This limits the range of indices that they can accept, and may force the user into doing an unnecessary cast. For context, `scatter` is implemented as `Take(values, InversePermutation(indices))`. `inverse_permutation` kernel explicitly checks for negative indices (https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/kernels/vector_swizzle.cc#L209): ```python indices = pa.array([0, -1, -2, -3]) pc.inverse_permutation(indices) # ArrowIndexError: Index out of bounds: -1 ``` Additionally, * `inverse_permutation` has kernels only for signed integers (https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/kernels/vector_swizzle.cc#L209) * `scatter` explicitly checks the type (https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/kernels/vector_swizzle.cc#L366) In the original PR, @pitrou brought up a concern about codegen size with supporting both, so only signed was implemented (https://github.com/apache/arrow/pull/44394#discussion_r1878473668) ### Component(s) Other -- 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]
