umtong opened a new pull request, #55274: URL: https://github.com/apache/arrow/pull/55274
### Rationale for this change The conditional compute functions currently have no matching kernels for `string_view` or `binary_view`, even when every value argument has the same type. This implements the support requested in #55255. ### What changes are included in this PR? This adds view kernels for `if_else`, `case_when`, `coalesce`, and `choose`. They copy the view descriptors, retain the backing buffers, and rebase buffer indices so selected out-of-line values remain valid after the inputs are released. Scalar conditions and leading non-null coalesce arguments keep the existing forwarding paths. The tests extend the existing binary-type cases and cover scalar/array combinations, empty and sliced inputs, multiple backing buffers, nulls, nested condition offsets, invalid choose indices, and output lifetime after releasing the inputs. ### Are these changes tested? - With the original implementation, all 16 new view cases fail with `NotImplemented: no kernel matching input types`. - With the new kernels, all 438 tests in `arrow-compute-scalar-if-else-test` pass across 140 suites. - Built in Debug mode with GCC 13.3.0 and `CHECKIN` warnings (`-Werror`). - Applied clang-format 18.1.8 to changed lines; `git diff --check` passes. [Build, baseline reproduction, and full conditional test run](https://github.com/umtong/arrow/actions/runs/40378101159) ยท [Formatting](https://github.com/umtong/arrow/actions/runs/40378859064) ### Are there any user-facing changes? The four functions now accept same-type `string_view` and `binary_view` value arguments. Fixes #55255. ### Was AI used for this PR? AI was used for the implementation, regression tests, and PR description. The review covered buffer ownership and rebasing, slice offsets, null propagation, and index validation. **PR code and description written by:** - [ ] Human - [x] AI **Reviewed before submission by:** - [ ] 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
