Repository navigation
Conversation
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
ArrayIterator<Type, enable_if_binary_view_like<Type>>incodegen_internal.hunconditionally callsutil::FromBinaryViewon every element before invokingOp::Call. Forequalandnot_equalonBinaryView/StringView(including the mixedBinaryViewvsBaseBinary/LargeBinarykernels from #55171), that dereferences out-of-line variadic buffers even when the 16-byte descriptor (sizeand 4-byte inlineprefix) mismatches.Adding an opt-in
CallViewdispatch path in the applicators avoids eager buffer dereferences on mismatch while keepingGetViewType<BinaryViewType>::T = std::string_viewand existingOp::Callkernels untouched.What changes are included in this PR?
binary_view_util.h: AddedBinaryViewAccessor,PinnedBinaryScalar(guarding null scalars and> INT32_MAXscalar lengths, with endian-safememcpyforsize_and_prefix),EqualBinaryViewString, andEqualBinaryViewValueoverloads constrained byIsBinaryViewOperand.codegen_internal.h: AddedViewDescriptorIterator,ViewScalarUnboxer,VisitBinaryViewValuesInline,VisitTwoBinaryViewValuesInline, andCallViewdispatch inScalarUnary,ScalarUnaryNotNullStateful,ScalarBinary, andScalarBinaryNotNullStateful.scalar_compare.cc: OptedEqualandNotEqualintoCallViewviautil::EqualBinaryViewValue.codegen_internal_test.cc&scalar_compare_test.cc: Added applicator tests (Callfallback,CallViewearly rejection with sentinel out-of-range buffer indices, sliced arrays, null/oversized scalars) and expandedTestBinaryViewCompareKernel.scalar_compare_benchmark.cc: AddedStringViewequality benchmarks (inline, out-of-line, shared-prefix, array-scalar, and mixedStringViewvsString).Benchmarks
Measured with
arrow-compute-scalar-compare-benchmark(65,536rows, median of 5 repetitions, Release GCC 16.2.0-O3 -DNDEBUG,-DARROW_SIMD_LEVEL=NONE -DARROW_RUNTIME_SIMD_LEVEL=NONE) comparingupstream/main(dd456e0) against this branch (bde2592):CallView)EqualArrayArrayStringViewEqualArrayArrayStringViewEqualArrayScalarStringViewEqualArrayScalarStringViewEqualArrayArrayStringViewInlineEqualArrayArrayStringViewInlineEqualArrayArrayStringViewOutOfLineEqualArrayArrayStringViewOutOfLineEqualArrayScalarStringViewOutOfLineEqualArrayScalarStringViewOutOfLineEqualArrayArrayStringViewSharedPrefixEqualArrayArrayStringViewSharedPrefixEqualArrayArrayStringViewStringEqualArrayArrayStringViewStringEqualArrayScalarStringViewStringEqualArrayScalarStringViewStringAre these changes tested?
Yes. Added unit tests in
codegen_internal_test.ccandscalar_compare_test.cc, and ranarrow-compute-kernel-utility-test,arrow-compute-scalar-math-test,arrow-compute-scalar-cast-test,arrow-compute-scalar-if-else-test, andarrow-compute-scalar-utility-test.Are there any user-facing changes?
No.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: