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

Function garrow_schema_replace_field

c_glib/arrow-glib/schema.cpp:390–404  ·  view source on GitHub ↗

* garrow_schema_replace_field: * @schema: A #GArrowSchema. * @i: The index of the field to be replaced. * @field: The newly added #GArrowField. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable) (transfer full): The newly allocated * #GArrowSchema that has @field as the @i-th field or %NULL on error. * * Since: 0.10.0 */

Source from the content-addressed store, hash-verified

388 * Since: 0.10.0
389 */
390GArrowSchema *
391garrow_schema_replace_field(GArrowSchema *schema,
392 guint i,
393 GArrowField *field,
394 GError **error)
395{
396 const auto arrow_schema = garrow_schema_get_raw(schema);
397 const auto arrow_field = garrow_field_get_raw(field);
398 auto maybe_new_schema = arrow_schema->SetField(i, arrow_field);
399 if (garrow::check(error, maybe_new_schema, "[schema][replace-field]")) {
400 return garrow_schema_new_raw(&(*maybe_new_schema));
401 } else {
402 return NULL;
403 }
404}
405
406/**
407 * garrow_schema_has_metadata:

Callers

nothing calls this directly

Calls 4

garrow_schema_get_rawFunction · 0.85
garrow_field_get_rawFunction · 0.85
checkFunction · 0.70
SetFieldMethod · 0.45

Tested by

no test coverage detected