* garrow_array_sort_indices: * @array: A #GArrowArray. * @order: The order for sort. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The indices that would sort * an array in the specified order on success, %NULL on error. * * Since: 3.0.0 */
| 5672 | * Since: 3.0.0 |
| 5673 | */ |
| 5674 | GArrowUInt64Array * |
| 5675 | garrow_array_sort_indices(GArrowArray *array, GArrowSortOrder order, GError **error) |
| 5676 | { |
| 5677 | auto arrow_array = garrow_array_get_raw(array); |
| 5678 | auto arrow_array_raw = arrow_array.get(); |
| 5679 | auto arrow_order = static_cast<arrow::compute::SortOrder>(order); |
| 5680 | auto arrow_indices_array = arrow::compute::SortIndices(*arrow_array_raw, arrow_order); |
| 5681 | if (garrow::check(error, arrow_indices_array, "[array][sort-indices]")) { |
| 5682 | return GARROW_UINT64_ARRAY(garrow_array_new_raw(&(*arrow_indices_array))); |
| 5683 | } else { |
| 5684 | return NULL; |
| 5685 | } |
| 5686 | } |
| 5687 | |
| 5688 | /** |
| 5689 | * garrow_array_sort_to_indices: |
no test coverage detected