You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zanmato1984 (via GitHub)" <gi...@apache.org> on 2026/10/24 06:27:05 UTC

[PR] GH-54920: [C++][Compute] Support unsigned indices in inverse_permutation and scatter [arrow]

zanmato1984 opened a new pull request, #55169:
URL: https://github.com/apache/arrow/pull/55169

   ### Rationale for this change
   
   `inverse_permutation` and `scatter` currently 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?
   
   - Accept signed and unsigned integer indices in both functions.
   - Allow unsigned inverse-permutation output types, with the default still following the input type.
   - Share input handling by bit width and validity generation by output width, while retaining specialized output writes.
   - Reduce the swizzle object's code section from 432,480 to 185,204 bytes (about 57.2% smaller, Apple Clang/O2).
   - Preserve signed-index checks and uint64 bounds diagnostics, and update the C++ and Python-facing documentation.
   
   ### 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:**
   
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-54920: [C++][Compute] Support unsigned indices in inverse_permutation and scatter [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #55169:
URL: https://github.com/apache/arrow/pull/55169#issuecomment-6380898607

   :warning: GitHub issue #54920 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org