Skip to content

[C++][Compute] Prefix-aware BinaryView/StringView execution for equal and not_equal #55801

Backlog

Description

@Awesome06

Describe the enhancement requested

ArrayIterator<Type, enable_if_binary_view_like<Type>> in codegen_internal.h unconditionally calls util::FromBinaryView per element before invoking Op::Call. For equal and not_equal on BinaryView / StringView (including mixed BinaryView vs BaseBinary / LargeBinary kernels from #55171), this dereferences out-of-line variadic buffers on every row even when the 16-byte descriptor (size and 4-byte inline prefix) mismatches.

Proposal

Add an opt-in CallView path at the applicator layer while leaving GetViewType<BinaryViewType>::T = std::string_view and existing Op::Call kernels untouched:

  • binary_view_util.h: Add BinaryViewAccessor (lazy descriptor access), PinnedBinaryScalar (hoists scalar length, 4-byte prefix, size_and_prefix, inlined bytes, and INT32_MAX range check outside the loop), EqualBinaryViewString, and EqualBinaryViewValue overloads guarded by IsBinaryViewOperand.
  • codegen_internal.h: Add ViewDescriptorIterator, ViewScalarUnboxer, and C++20 CallView dispatch in ScalarUnary, ScalarUnaryNotNullStateful, ScalarBinary, and ScalarBinaryNotNullStateful.
  • scalar_compare.cc: Opt Equal and NotEqual into CallView via util::EqualBinaryViewValue.

Follow-up kernels (ordering comparisons, string matching, set lookup, sort/aggregates) will be tracked separately.

Component(s)

C++

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions