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

Function garrow_array_count_values

c_glib/arrow-glib/compute.cpp:5057–5068  ·  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

5055 * Since: 0.13.0
5056 */
5057GArrowStructArray *
5058garrow_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:

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