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

Function garrow_array_sort_indices

c_glib/arrow-glib/compute.cpp:5719–5731  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

5717 * Since: 3.0.0
5718 */
5719GArrowUInt64Array *
5720garrow_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:

Callers 1

Calls 5

SortIndicesFunction · 0.85
garrow_array_new_rawFunction · 0.85
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected