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

Function garrow_table_replace_column

c_glib/arrow-glib/table.cpp:615–631  ·  view source on GitHub ↗

* 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. * *

Source from the content-addressed store, hash-verified

613 * Since: 0.15.0
614 */
615GArrowTable *
616garrow_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:

Callers

nothing calls this directly

Calls 5

garrow_table_get_rawFunction · 0.85
garrow_field_get_rawFunction · 0.85
checkFunction · 0.70
SetColumnMethod · 0.45

Tested by

no test coverage detected