| 65 | |
| 66 | template <typename ArrowType> |
| 67 | Result<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 | |
| 90 | template <typename ArrowType> |
| 91 | Result<NullPartitionResult> DoSortAndMarkDuplicate( |
nothing calls this directly
no test coverage detected