* garrow_array_unique: * @array: A #GArrowArray. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): * A newly created unique elements array on success, %NULL on error. * * Since: 0.8.0 */
| 4917 | * Since: 0.8.0 |
| 4918 | */ |
| 4919 | GArrowArray * |
| 4920 | garrow_array_unique(GArrowArray *array, GError **error) |
| 4921 | { |
| 4922 | auto arrow_array = garrow_array_get_raw(array); |
| 4923 | auto arrow_unique_array = arrow::compute::Unique(arrow_array); |
| 4924 | if (garrow::check(error, arrow_unique_array, [&]() { |
| 4925 | std::stringstream message; |
| 4926 | message << "[array][unique] <"; |
| 4927 | message << arrow_array->type()->ToString(); |
| 4928 | message << ">"; |
| 4929 | return message.str(); |
| 4930 | })) { |
| 4931 | return garrow_array_new_raw(&(*arrow_unique_array)); |
| 4932 | } else { |
| 4933 | return NULL; |
| 4934 | } |
| 4935 | } |
| 4936 | |
| 4937 | /** |
| 4938 | * garrow_array_dictionary_encode: |
nothing calls this directly
no test coverage detected