* garrow_table_concatenate: * @table: A #GArrowTable. * @other_tables: (element-type GArrowTable): The tables to be concatenated. * @options: (nullable): The options to customize concatenation. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The table concatenated vertically. * * Since: 0.14.0 */
| 662 | * Since: 0.14.0 |
| 663 | */ |
| 664 | GArrowTable * |
| 665 | garrow_table_concatenate(GArrowTable *table, |
| 666 | GList *other_tables, |
| 667 | GArrowTableConcatenateOptions *options, |
| 668 | GError **error) |
| 669 | { |
| 670 | auto arrow_table = garrow_table_get_raw(table); |
| 671 | std::vector<std::shared_ptr<arrow::Table>> arrow_tables = {arrow_table}; |
| 672 | for (auto node = other_tables; node; node = g_list_next(node)) { |
| 673 | auto arrow_other_table = garrow_table_get_raw(GARROW_TABLE(node->data)); |
| 674 | arrow_tables.push_back(arrow_other_table); |
| 675 | } |
| 676 | auto arrow_options = arrow::ConcatenateTablesOptions::Defaults(); |
| 677 | if (options) { |
| 678 | auto options_priv = GARROW_TABLE_CONCATENATE_OPTIONS_GET_PRIVATE(options); |
| 679 | arrow_options = options_priv->options; |
| 680 | } |
| 681 | auto arrow_concatenated_table_result = |
| 682 | arrow::ConcatenateTables(arrow_tables, arrow_options); |
| 683 | if (garrow::check(error, arrow_concatenated_table_result, "[table][concatenate]")) { |
| 684 | auto arrow_concatenated_table = std::move(*arrow_concatenated_table_result); |
| 685 | return garrow_table_new_raw(&arrow_concatenated_table); |
| 686 | } else { |
| 687 | return NULL; |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | /** |
| 692 | * garrow_table_slice: |
nothing calls this directly
no test coverage detected