* 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 */
| 5717 | * Since: 3.0.0 |
| 5718 | */ |
| 5719 | GArrowUInt64Array * |
| 5720 | garrow_array_sort_indices(GArrowArray *array, GArrowSortOrder order, GError **error) |
| 5721 | { |
| 5722 | auto arrow_array = garrow_array_get_raw(array); |
| 5723 | auto arrow_array_raw = arrow_array.get(); |
| 5724 | auto arrow_order = static_cast<arrow::compute::SortOrder>(order); |
| 5725 | auto arrow_indices_array = arrow::compute::SortIndices(*arrow_array_raw, arrow_order); |
| 5726 | if (garrow::check(error, arrow_indices_array, "[array][sort-indices]")) { |
| 5727 | return GARROW_UINT64_ARRAY(garrow_array_new_raw(&(*arrow_indices_array))); |
| 5728 | } else { |
| 5729 | return NULL; |
| 5730 | } |
| 5731 | } |
| 5732 | |
| 5733 | /** |
| 5734 | * garrow_array_sort_to_indices: |
no test coverage detected