* 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 */
| 5055 | * Since: 0.13.0 |
| 5056 | */ |
| 5057 | GArrowStructArray * |
| 5058 | garrow_array_count_values(GArrowArray *array, GError **error) |
| 5059 | { |
| 5060 | auto arrow_array = garrow_array_get_raw(array); |
| 5061 | auto arrow_counted_values = arrow::compute::ValueCounts(arrow_array); |
| 5062 | if (garrow::check(error, arrow_counted_values, "[array][count-values]")) { |
| 5063 | std::shared_ptr<arrow::Array> arrow_counted_values_array = *arrow_counted_values; |
| 5064 | return GARROW_STRUCT_ARRAY(garrow_array_new_raw(&arrow_counted_values_array)); |
| 5065 | } else { |
| 5066 | return NULL; |
| 5067 | } |
| 5068 | } |
| 5069 | |
| 5070 | /** |
| 5071 | * garrow_boolean_array_invert: |
nothing calls this directly
no test coverage detected