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

Function garrow_array_export

c_glib/arrow-glib/basic-array.cpp:889–917  ·  view source on GitHub ↗

* garrow_array_export: * @array: A #GArrowArray. * @c_abi_array: (out): Return location for a `struct ArrowArray *`. * It should be freed with the `ArrowArray::release` callback then * g_free() when no longer needed. * @c_abi_schema: (out) (nullable): Return location for a * `struct ArrowSchema *` or %NULL. * It should be freed with the `ArrowSchema::release` callback then * g_fr

Source from the content-addressed store, hash-verified

887 * Since: 6.0.0
888 */
889gboolean
890garrow_array_export(GArrowArray *array,
891 gpointer *c_abi_array,
892 gpointer *c_abi_schema,
893 GError **error)
894{
895 const auto arrow_array = garrow_array_get_raw(array);
896 *c_abi_array = g_new(ArrowArray, 1);
897 arrow::Status status;
898 if (c_abi_schema) {
899 *c_abi_schema = g_new(ArrowSchema, 1);
900 status = arrow::ExportArray(*arrow_array,
901 static_cast<ArrowArray *>(*c_abi_array),
902 static_cast<ArrowSchema *>(*c_abi_schema));
903 } else {
904 status = arrow::ExportArray(*arrow_array, static_cast<ArrowArray *>(*c_abi_array));
905 }
906 if (garrow::check(error, status, "[array][export]")) {
907 return true;
908 } else {
909 g_free(*c_abi_array);
910 *c_abi_array = nullptr;
911 if (c_abi_schema) {
912 g_free(*c_abi_schema);
913 *c_abi_schema = nullptr;
914 }
915 return false;
916 }
917}
918
919/**
920 * garrow_array_equal:

Callers

nothing calls this directly

Calls 3

garrow_array_get_rawFunction · 0.70
checkFunction · 0.70
ExportArrayFunction · 0.50

Tested by

no test coverage detected