MCPcopy Create free account
hub / github.com/apache/arrow / Sort

Method Sort

cpp/src/arrow/compute/kernels/vector_sort.cc:400–414  ·  view source on GitHub ↗

Offset is for table sorting

Source from the content-addressed store, hash-verified

398
399 // Offset is for table sorting
400 Result<NullLikePartition> Sort(int64_t offset = 0) {
401 ARROW_RETURN_NOT_OK(status_);
402
403 // Create column sorters from right to left
404 std::vector<std::unique_ptr<RecordBatchColumnSorter>> column_sorts(sort_keys_.size());
405 RecordBatchColumnSorter* next_column = nullptr;
406 for (int64_t i = static_cast<int64_t>(sort_keys_.size() - 1); i >= 0; --i) {
407 ColumnSortFactory factory(sort_keys_[i], next_column);
408 ARROW_ASSIGN_OR_RAISE(column_sorts[i], factory.MakeColumnSort());
409 next_column = column_sorts[i].get();
410 }
411
412 // Sort from left to right
413 return column_sorts.front()->SortRange(indices_, offset);
414 }
415
416 protected:
417 struct ColumnSortFactory {

Callers

nothing calls this directly

Calls 5

MakeColumnSortMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
sizeMethod · 0.45
getMethod · 0.45
SortRangeMethod · 0.45

Tested by

no test coverage detected