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

Function garrow_table_add_column

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

* garrow_table_add_column: * @table: A #GArrowTable. * @i: The index of the new column. * @field: The field for the column to be added. * @chunked_array: The column data to be added. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The newly allocated * #GArrowTable that has a new column or %NULL on error. * * Since: 0.15.0 */

Source from the content-addressed store, hash-verified

558 * Since: 0.15.0
559 */
560GArrowTable *
561garrow_table_add_column(GArrowTable *table,
562 guint i,
563 GArrowField *field,
564 GArrowChunkedArray *chunked_array,
565 GError **error)
566{
567 const auto arrow_table = garrow_table_get_raw(table);
568 const auto arrow_field = garrow_field_get_raw(field);
569 const auto arrow_chunked_array = garrow_chunked_array_get_raw(chunked_array);
570 auto maybe_new_table = arrow_table->AddColumn(i, arrow_field, arrow_chunked_array);
571 if (garrow::check(error, maybe_new_table, "[table][add-column]")) {
572 return garrow_table_new_raw(&(*maybe_new_table));
573 } else {
574 return NULL;
575 }
576}
577
578/**
579 * garrow_table_remove_column:

Callers

nothing calls this directly

Calls 5

garrow_table_get_rawFunction · 0.85
garrow_field_get_rawFunction · 0.85
checkFunction · 0.70
AddColumnMethod · 0.45

Tested by

no test coverage detected