taepper commented on code in PR #50248:
URL: https://github.com/apache/arrow/pull/50248#discussion_r3473197349
##########
cpp/src/arrow/compute/kernels/vector_sort.cc:
##########
@@ -679,33 +656,36 @@ class TableSorter {
for (int64_t i = 0; i < num_batches; ++i) {
const auto& batch = *batches_[i];
end_offset += batch.num_rows();
- RadixRecordBatchSorter sorter(indices_begin_ + begin_offset,
- indices_begin_ + end_offset, batch,
options_);
+ RadixRecordBatchSorter sorter(
+ {indices_.data() + begin_offset, indices_.data() + end_offset},
batch,
+ options_);
ARROW_ASSIGN_OR_RAISE(sorted[i], sorter.Sort(begin_offset));
- DCHECK_EQ(sorted[i].overall_begin(), indices_begin_ + begin_offset);
- DCHECK_EQ(sorted[i].overall_end(), indices_begin_ + end_offset);
- DCHECK_EQ(sorted[i].non_null_count() + sorted[i].null_count(),
batch.num_rows());
+ DCHECK_EQ(sorted[i].overall_begin(), indices_.data() + begin_offset);
+ DCHECK_EQ(sorted[i].overall_end(), indices_.data() + end_offset);
+ DCHECK_EQ(static_cast<int64_t>(sorted[i].non_null_like_range.size() +
+ sorted[i].null_range.size()),
+ batch.num_rows());
begin_offset = end_offset;
// XXX this is an upper bound on the true null count
Review Comment:
That seems right. I also noticed that this `null_count` was able to be
removed entirely (no longer used in `Merge{AtStart,AtEnd,}`)
##########
cpp/src/arrow/compute/kernels/vector_sort.cc:
##########
@@ -679,33 +656,36 @@ class TableSorter {
for (int64_t i = 0; i < num_batches; ++i) {
const auto& batch = *batches_[i];
end_offset += batch.num_rows();
- RadixRecordBatchSorter sorter(indices_begin_ + begin_offset,
- indices_begin_ + end_offset, batch,
options_);
+ RadixRecordBatchSorter sorter(
+ {indices_.data() + begin_offset, indices_.data() + end_offset},
batch,
+ options_);
ARROW_ASSIGN_OR_RAISE(sorted[i], sorter.Sort(begin_offset));
- DCHECK_EQ(sorted[i].overall_begin(), indices_begin_ + begin_offset);
- DCHECK_EQ(sorted[i].overall_end(), indices_begin_ + end_offset);
- DCHECK_EQ(sorted[i].non_null_count() + sorted[i].null_count(),
batch.num_rows());
+ DCHECK_EQ(sorted[i].overall_begin(), indices_.data() + begin_offset);
+ DCHECK_EQ(sorted[i].overall_end(), indices_.data() + end_offset);
+ DCHECK_EQ(static_cast<int64_t>(sorted[i].non_null_like_range.size() +
+ sorted[i].null_range.size()),
+ batch.num_rows());
begin_offset = end_offset;
// XXX this is an upper bound on the true null count
Review Comment:
That seems right. I also noticed that this `null_count` was able to be
removed entirely (no longer used in `Merge{,AtStart,AtEnd}`)
--
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]