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

Function garrow_struct_array_flatten

c_glib/arrow-glib/composite-array.cpp:1057–1076  ·  view source on GitHub ↗

* garrow_struct_array_flatten * @array: A #GArrowStructArray. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (element-type GArrowArray) (transfer full): * The fields in the struct. * * Since: 0.10.0 */

Source from the content-addressed store, hash-verified

1055 * Since: 0.10.0
1056 */
1057GList *
1058garrow_struct_array_flatten(GArrowStructArray *array, GError **error)
1059{
1060 const auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
1061 auto arrow_struct_array = std::static_pointer_cast<arrow::StructArray>(arrow_array);
1062
1063 auto memory_pool = arrow::default_memory_pool();
1064 auto arrow_arrays = arrow_struct_array->Flatten(memory_pool);
1065 if (!garrow::check(error, arrow_arrays, "[struct-array][flatten]")) {
1066 return NULL;
1067 }
1068
1069 GList *arrays = NULL;
1070 for (auto arrow_array : *arrow_arrays) {
1071 auto array = garrow_array_new_raw(&arrow_array);
1072 arrays = g_list_prepend(arrays, array);
1073 }
1074
1075 return g_list_reverse(arrays);
1076}
1077
1078typedef struct GArrowMapArrayPrivate_
1079{

Callers

nothing calls this directly

Calls 5

default_memory_poolFunction · 0.85
garrow_array_new_rawFunction · 0.85
garrow_array_get_rawFunction · 0.70
checkFunction · 0.70
FlattenMethod · 0.45

Tested by

no test coverage detected