* garrow_table_replace_column: * @table: A #GArrowTable. * @i: The index of the column to be replaced. * @field: The field for the new column. * @chunked_array: The newly added column data. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The newly allocated * #GArrowTable that has @column as the @i-th column or %NULL on * error. * *
| 613 | * Since: 0.15.0 |
| 614 | */ |
| 615 | GArrowTable * |
| 616 | garrow_table_replace_column(GArrowTable *table, |
| 617 | guint i, |
| 618 | GArrowField *field, |
| 619 | GArrowChunkedArray *chunked_array, |
| 620 | GError **error) |
| 621 | { |
| 622 | const auto arrow_table = garrow_table_get_raw(table); |
| 623 | const auto arrow_field = garrow_field_get_raw(field); |
| 624 | const auto arrow_chunked_array = garrow_chunked_array_get_raw(chunked_array); |
| 625 | auto maybe_new_table = arrow_table->SetColumn(i, arrow_field, arrow_chunked_array); |
| 626 | if (garrow::check(error, maybe_new_table, "[table][replace-column]")) { |
| 627 | return garrow_table_new_raw(&(*maybe_new_table)); |
| 628 | } else { |
| 629 | return NULL; |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | /** |
| 634 | * garrow_table_to_string: |
nothing calls this directly
no test coverage detected