Skip to content

GH-55255: [C++][Compute] Support binary views in conditional kernels - #55274

Open
umtong wants to merge 2 commits into
apache:mainfrom
umtong:fix/conditional-binary-views-55255
Open

umtong wants to merge 2 commits into
apache:mainfrom
umtong:fix/conditional-binary-views-55255

Conversation

@umtong

@umtong umtong commented Oct 26, 2026 •

Copy link
Copy Markdown

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 · Formatting

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
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Assisted by Codex.

…rnels

Add string_view and binary_view kernels for if_else, case_when, coalesce,
and choose. Retain backing buffers and rebase selected view descriptors
without copying out-of-line payloads.

Cover scalar and sliced inputs, nulls, multiple buffers, nested condition
offsets, invalid choose indices, and output lifetime after input release.
@github-actions github-actions Bot added the awaiting review Awaiting review label Oct 26, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55255 has no components, please add labels for components.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55255 has no components, please add labels for components.

2 similar comments
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55255 has no components, please add labels for components.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55255 has no components, please add labels for components.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][Compute] Conditional compute kernels (if_else, coalesce, case_when, choose) do not support string_view or binary_view

1 participant