Copilot commented on code in PR #50329:
URL: https://github.com/apache/arrow/pull/50329#discussion_r3557019000
##########
cpp/src/arrow/compute/kernels/vector_select_k.cc:
##########
@@ -118,22 +117,22 @@ void HeapSortNonNullsToOutput(std::span<uint64_t>
non_null_input_range, Comparat
return;
}
std::span<uint64_t> heap = non_null_input_range.subspan(0,
output_range.size());
- std::ranges::make_heap(heap, cmp);
+ std::make_heap(heap.begin(), heap.end(), cmp);
std::span<uint64_t> remaining_input =
non_null_input_range.subspan(output_range.size());
for (uint64_t x_index : remaining_input) {
if (cmp(x_index, heap.front())) {
- std::ranges::pop_heap(heap, cmp);
+ std::pop_heap(heap.begin(), heap.end(), cmp);
heap.back() = x_index;
- std::ranges::push_heap(heap, cmp);
+ std::push_heap(heap.begin(), heap.end(), cmp);
}
}
// fill output in reverse when destructing,
// as the "worst" (next-to-would-have-been-replaced) element is at heap-top
- for (auto& reverse_out_iter : std::ranges::reverse_view(output_range)) {
- reverse_out_iter = heap.front(); // heap-top has the next element
- std::ranges::pop_heap(heap, cmp);
+ for (int64_t i = output_range.size(); i > 0; --i) {
+ output_range[i - 1] = heap.front(); // heap-top has the next element
+ std::pop_heap(heap.begin(), heap.end(), cmp);
// Decrease heap-size by one
heap = heap.first(heap.size() - 1);
}
Review Comment:
The reverse-fill loop uses `int64_t i = output_range.size()` (where `size()`
is `size_t`), introducing an implicit narrowing conversion and potential
signed/unsigned warnings. Prefer a `size_t` reverse loop pattern to avoid
conversions.
##########
cpp/src/arrow/compute/kernels/vector_select_k.cc:
##########
@@ -422,9 +421,8 @@ class ChunkedArraySelector : public TypeVisitor {
// so the heap must have been completely filled
DCHECK_EQ(heap.size(), output.non_null_like_range.size());
- for (uint64_t& reverse_out_iter :
- std::ranges::reverse_view(output.non_null_like_range)) {
- reverse_out_iter =
+ for (int64_t i = output.non_null_like_range.size(); i > 0; --i) {
+ output.non_null_like_range[i - 1] =
heap.top().index + heap.top().offset; // heap-top has the next
element
heap.pop();
}
Review Comment:
Same as above: `int64_t i = output.non_null_like_range.size()` implicitly
converts from `size_t`, which can trigger signed/unsigned warnings. Use a
`size_t` reverse loop idiom instead.
##########
CHANGELOG.md:
##########
@@ -1,4 +1,235 @@
+# Apache Arrow 25.0.0 (2026-07-07 00:00:00+00:00)
Review Comment:
The PR description explicitly says this is a CI-status check and should not
be merged, but the diff contains real release-version and changelog updates
that would be mergeable on their own. If this is truly a dummy PR, please close
it (or mark as draft) after CI verification to avoid accidental merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]