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

Function garrow_array_count_values

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

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

Source from the content-addressed store, hash-verified

5010 * Since: 0.13.0
5011 */
5012GArrowStructArray *
5013garrow_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:

Callers

nothing calls this directly

Calls 3

garrow_array_new_rawFunction · 0.85
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70

Tested by

no test coverage detected