Skip to content

GH-55616: [C++][Compute] Support decimal and fixed_size_binary types in search_sorted - #55617

Open
SohamDutta02 wants to merge 1 commit into
apache:mainfrom
SohamDutta02:search-sorted-decimal-fsb
Open

SohamDutta02 wants to merge 1 commit into
apache:mainfrom
SohamDutta02:search-sorted-decimal-fsb

Conversation

@SohamDutta02

@SohamDutta02 SohamDutta02 commented Nov 14, 2026 •

Copy link
Copy Markdown

Rationale for this change

search_sorted raised NotImplemented for decimal32/64/128/256 and fixed_size_binary inputs, even though these types are orderable and supported by sort_indices.

What changes are included in this PR?

  • Add FixedSizeBinaryType and Decimal32/64/128/256Type to the search_sorted type dispatch. The binary search itself is unchanged: GetViewType and CompareTypeValues already handle these types.
  • Stop calling TypeTraits<T>::type_singleton(), which only exists for parameter-free types, in VisitArrayNeedleRuns and ComputeInsertionIndices. Parametric needles already have the values' exact type, so they are used as-is.

Are these changes tested?

Yes. Smoke cases for the five new types were added to the parametrized array/scalar tests (the decimal cases include negative values), plus a run-end encoded decimal test with a leading null and a null needle. arrow-compute-vector-search-sorted-test passes locally.

Are there any user-facing changes?

Yes: search_sorted now accepts decimal and fixed_size_binary inputs.

Was AI used for this PR?

Yes. The tests and description were AI-assisted; I reviewed the diff and the test results before submitting.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

…sorted

search_sorted raised NotImplemented for decimal32/64/128/256 and
fixed_size_binary inputs, although these types are orderable and
already supported by sort_indices.

Add them to the type dispatch. The search itself needs no changes
since GetViewType and CompareTypeValues already handle them; only the
two type_singleton() calls, which don't exist for parametric types,
are adjusted.
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55616 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.

1 participant