* garrow_array_count_values: * @array: A #GArrowArray. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): * A #GArrowStructArray of `{input type "values", int64_t "counts"}` * on success, %NULL on error. * * Since: 0.13.0 */
| 5010 | * Since: 0.13.0 |
| 5011 | */ |
| 5012 | GArrowStructArray * |
| 5013 | garrow_array_count_values(GArrowArray *array, GError **error) |
| 5014 | { |
| 5015 | auto arrow_array = garrow_array_get_raw(array); |
| 5016 | auto arrow_counted_values = arrow::compute::ValueCounts(arrow_array); |
| 5017 | if (garrow::check(error, arrow_counted_values, "[array][count-values]")) { |
| 5018 | std::shared_ptr<arrow::Array> arrow_counted_values_array = *arrow_counted_values; |
| 5019 | return GARROW_STRUCT_ARRAY(garrow_array_new_raw(&arrow_counted_values_array)); |
| 5020 | } else { |
| 5021 | return NULL; |
| 5022 | } |
| 5023 | } |
| 5024 | |
| 5025 | /** |
| 5026 | * garrow_boolean_array_invert: |
nothing calls this directly
no test coverage detected