GH-50636: [C++][R] Fix macOS 11.3 std::span construction in vector_sort#50651
GH-50636: [C++][R] Fix macOS 11.3 std::span construction in vector_sort#50651KHARSHAVARDHAN-eng wants to merge 1 commit into
Conversation
|
|
|
@github-actions crossbow submit -g r |
|
Could you use our PR template? (You can make PR ready after it.) Could you read https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code ? |
|
Revision: 99e8db3 Submitted crossbow builds: ursacomputing/crossbow @ actions-5c2ee98607 |
There was a problem hiding this comment.
The issue description points to the std::span construction in vector_sort.cc, but this PR only changes vector_sort_internal.h. Also, the test-r-macos-as-cran Crossbow job is still failing with the same cannot convert initializer list argument to std::span<uint64_t> error in vector_sort.cc. Could you clarify how these changes resolve the compilation failure reported in GH-50636?
Rationale for this change
Building Apache Arrow on macOS using older LLVM
libc++toolchains (such as Xcode 12.5 shipped with the macOS 11.3 SDK) fails when compiling thevector_sortcompute kernel due to unsupportedstd::spanrange constructors.What changes are included in this PR?
In
cpp/src/arrow/compute/kernels/vector_sort_internal.h:NonStablePartitioner&StablePartitioner: Replaced non-conformingstd::span<uint64_t>{middle, indices.data() + indices.size()}withindices.subspan(middle - indices.data()).ChunkedMergeImpl::MergeNullsAtStart&MergeNullsAtEnd: Replacedstd::span<CompressedChunkLocation>{left.overall_begin(), right.overall_end()}withstd::span<CompressedChunkLocation>{left.overall_begin(), static_cast<size_t>(right.overall_end() - left.overall_begin())}.Both
.subspan(offset)andstd::span(pointer, size_type)are standard C++20 and supported on older macOS libc++ implementations.Verification
Closes #50636