Sumdiboii opened a new pull request, #55957: URL: https://github.com/apache/arrow/pull/55957
### Rationale for this change Taking from a chunked array with an empty chunked indices array should produce an empty result without doing unnecessary work on the values so why not... ### What changes are included in this PR? Return a typed empty result when the indices have no chunks, without concatenating the values. Reuse the indices' chunk count for allocation and iteration in the non-empty case. ### Are these changes tested? - `ninja -C cpp -j1 arrow-compute-vector-selection-test` — passed. - `cpp/build/release/arrow-compute-vector-selection-test --gtest_filter='TestTakeKernelWithChunkedIndices.*'` — passed. - `cpp/build/release/arrow-compute-vector-selection-test` — passed (168 tests). ### Are there any user-facing changes? No. ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [x] Human - [ ] AI **Reviewed before submission by:** - [x] Human - [x] AI - [ ] Not reviewed * GitHub Issue: Closes #55956 -- 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]
