* garrow_array_concatenate: * @array: A #GArrowArray. * @other_arrays: (element-type GArrowArray): A #GArrowArray to be * concatenated. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The concatenated array. * * Since: 4.0.0 */
| 1268 | * Since: 4.0.0 |
| 1269 | */ |
| 1270 | GArrowArray * |
| 1271 | garrow_array_concatenate(GArrowArray *array, GList *other_arrays, GError **error) |
| 1272 | { |
| 1273 | if (!other_arrays) { |
| 1274 | g_object_ref(array); |
| 1275 | return array; |
| 1276 | } |
| 1277 | arrow::ArrayVector arrow_arrays; |
| 1278 | arrow_arrays.push_back(garrow_array_get_raw(array)); |
| 1279 | for (auto node = other_arrays; node; node = node->next) { |
| 1280 | auto other_array = GARROW_ARRAY(node->data); |
| 1281 | arrow_arrays.push_back(garrow_array_get_raw(other_array)); |
| 1282 | } |
| 1283 | auto arrow_concatenated_array = arrow::Concatenate(arrow_arrays); |
| 1284 | if (garrow::check(error, arrow_concatenated_array, "[array][concatenate]")) { |
| 1285 | return garrow_array_new_raw(&(*arrow_concatenated_array)); |
| 1286 | } else { |
| 1287 | return NULL; |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | /** |
| 1292 | * garrow_array_validate: |
nothing calls this directly
no test coverage detected