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

Function garrow_struct_array_get_field

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

* garrow_struct_array_get_field * @array: A #GArrowStructArray. * @i: The index of the field in the struct. * * Returns: (transfer full): The i-th field. */

Source from the content-addressed store, hash-verified

1007 * Returns: (transfer full): The i-th field.
1008 */
1009GArrowArray *
1010garrow_struct_array_get_field(GArrowStructArray *array, gint i)
1011{
1012 auto fields = garrow_struct_array_get_fields_internal(array);
1013 if (i < 0) {
1014 i += fields->len;
1015 }
1016 if (i < 0) {
1017 return NULL;
1018 }
1019 if (i >= static_cast<gint>(fields->len)) {
1020 return NULL;
1021 }
1022 auto field = static_cast<GArrowArray *>(g_ptr_array_index(fields, i));
1023 g_object_ref(field);
1024 return field;
1025}
1026
1027/**
1028 * garrow_struct_array_get_fields

Callers

nothing calls this directly

Tested by

no test coverage detected