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

Function DoSortAndMarkDuplicate

cpp/src/arrow/compute/kernels/vector_rank.cc:67–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66template <typename ArrowType>
67Result<NullPartitionResult> DoSortAndMarkDuplicate(
68 ExecContext* ctx, uint64_t* indices_begin, uint64_t* indices_end, const Array& input,
69 const std::shared_ptr<DataType>& physical_type, const SortOrder order,
70 const NullPlacement null_placement, bool needs_duplicates) {
71 using GetView = GetViewType<ArrowType>;
72 using ArrayType = typename TypeTraits<ArrowType>::ArrayType;
73
74 ARROW_ASSIGN_OR_RAISE(auto array_sorter, GetArraySorter(*physical_type));
75
76 ArrayType array(input.data());
77 ARROW_ASSIGN_OR_RAISE(auto sorted,
78 array_sorter(indices_begin, indices_end, array, 0,
79 ArraySortOptions(order, null_placement), ctx));
80
81 if (needs_duplicates) {
82 auto value_selector = [&array](int64_t index) {
83 return GetView::LogicalValue(array.GetView(index));
84 };
85 MarkDuplicates(sorted, value_selector);
86 }
87 return sorted;
88}
89
90template <typename ArrowType>
91Result<NullPartitionResult> DoSortAndMarkDuplicate(

Callers

nothing calls this directly

Calls 3

GetPhysicalChunksFunction · 0.85
dataMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected