* 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 */
| 4962 | * Since: 0.8.0 |
| 4963 | */ |
| 4964 | GArrowArray * |
| 4965 | garrow_array_unique(GArrowArray *array, GError **error) |
| 4966 | { |
| 4967 | auto arrow_array = garrow_array_get_raw(array); |
| 4968 | auto arrow_unique_array = arrow::compute::Unique(arrow_array); |
| 4969 | if (garrow::check(error, arrow_unique_array, [&]() { |
| 4970 | std::stringstream message; |
| 4971 | message << "[array][unique] <"; |
| 4972 | message << arrow_array->type()->ToString(); |
| 4973 | message << ">"; |
| 4974 | return message.str(); |
| 4975 | })) { |
| 4976 | return garrow_array_new_raw(&(*arrow_unique_array)); |
| 4977 | } else { |
| 4978 | return NULL; |
| 4979 | } |
| 4980 | } |
| 4981 | |
| 4982 | /** |
| 4983 | * garrow_array_dictionary_encode: |
nothing calls this directly
no test coverage detected