Skip to content

GH-25505: [C++][Python] Add replace_with_indices compute kernel - #50809

Open
Kanishk-Dendukuri wants to merge 1 commit into
apache:mainfrom
Kanishk-Dendukuri:replace-with-indices
Open

GH-25505: [C++][Python] Add replace_with_indices compute kernel#50809
Kanishk-Dendukuri wants to merge 1 commit into
apache:mainfrom
Kanishk-Dendukuri:replace-with-indices

Conversation

@Kanishk-Dendukuri

@Kanishk-Dendukuri Kanishk-Dendukuri commented Aug 4, 2026

Copy link
Copy Markdown

Rationale for this change

replace_with_indices implements a SetItem kernel that overwrites elements of an array at positions given by an integer index array. It is the index based counterpart to the existing mask-based replace_with_mask.

What changes are included in this PR?

New replace_with_indices vector kernel with docs and benchmarks. Replacement i is written to position indices[i]. duplicate indices keep the last write, null indices are ignored, and out of bounds or negative indices raise an error.

Are these changes tested?

Yes. C++ typed tests, randomized cross check against a naive reference, and Python tests.

Are there any user-facing changes?

Yes. Its a new public compute function. No changes to existing functions.

AI Usage

Parts of the code, tests, and this description were written with AI assistance.

Closes #25505

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #25505 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++/Python] Kernel for SetItem(IntegerArray, values) ("replace_with_indices")

1 participant