Repository navigation
GH-54920: [C++][Compute] Support unsigned indices in inverse_permutation and scatter - #55169
Open
zanmato1984 wants to merge 1 commit into
Open
zanmato1984 wants to merge 1 commit into
zanmato1984 wants to merge 1 commit into
Conversation
…atter Signed-off-by: Rossi Sun <zanmato1984@gmail.com>
|
|
zanmato1984
marked this pull request as ready for review
October 24, 2026 06:38
zanmato1984
requested review from
AlenkaF,
pitrou,
raulcd and
rok
as code owners
October 24, 2026 06:38
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in dispatch, bounds checks, or validity generation, with added tests covering key boundary cases.
No open issues 🎉
What changed in this PR
Adds unsigned integer support to C++ compute functions inverse_permutation and scatter, addressing GH-54920 while reducing generated code size.
Changes:
- Accept signed and unsigned indices, and allow unsigned inverse-permutation outputs.
- Share input processing and validity generation by integer width while preserving bounds checks.
- Expand boundary, sliced-array, and chunked-array tests and update public documentation.
| File | Description |
|---|---|
python/pyarrow/_compute.pyx |
Document unsigned inverse-permutation output support. |
docs/source/cpp/compute.rst |
List integer input and output support. |
cpp/src/arrow/compute/kernels/vector_swizzle.cc |
Add unsigned support and consolidate kernel implementations. |
cpp/src/arrow/compute/kernels/vector_swizzle_test.cc |
Expand integer-type and boundary-case coverage. |
cpp/src/arrow/compute/api_vector.h |
Document signed and unsigned integer support. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
inverse_permutationandscattercurrently accept only signed integer indices, requiring unnecessary casts for unsigned arrays. This PR adds unsigned support while reducing generated code size.What changes are included in this PR?
Are these changes tested?
Added unit tests for unsigned types, index bounds, sliced/chunked inputs, and validity bitmap boundaries.
Are there any user-facing changes?
Unsigned integer indices are now accepted. For example, inverse permutation of uint8
[2, null, 0, 1]returns uint8[2, 3, 0, null].No breaking API changes.
Was AI used for this PR?
The changes were thoroughly reviewed by a human with AI assistance.
PR code and description written by:
Reviewed before submission by:
inverse_permutationandscattershould accept unsigned integers #54920