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

Function garrow_array_export

c_glib/arrow-glib/basic-array.cpp:890–918  ·  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

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