GArrowSchema

GArrowSchema — Schema class

Functions

Properties

gpointer schema Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GArrowSchema

Description

GArrowSchema is a class for schema. Schema is metadata of a table. It has zero or more GArrowFields.

Functions

garrow_schema_import ()

GArrowSchema *
garrow_schema_import (gpointer c_abi_schema,
                      GError **error);

Parameters

c_abi_schema

A struct ArrowSchema *.

[not nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

An imported GArrowSchema on success, NULL on error.

You don't need to release the passed struct ArrowSchema *, even if this function reports an error.

[transfer full][nullable]

Since: 6.0.0


garrow_schema_new ()

GArrowSchema *
garrow_schema_new (GList *fields);

Parameters

fields

The fields of the schema.

[element-type GArrowField]

Returns

A newly created GArrowSchema.


garrow_schema_export ()

gpointer
garrow_schema_export (GArrowSchema *schema,
                      GError **error);

Parameters

schema

A GArrowSchema.

 

error

Return location for a GError or NULL.

[nullable]

Returns

An exported GArrowSchema as struct ArrowStruct * on success, NULL on error.

It should be freed with the ArrowSchema::release callback then g_free() when no longer needed.

[transfer full][nullable]

Since: 6.0.0


garrow_schema_equal ()

gboolean
garrow_schema_equal (GArrowSchema *schema,
                     GArrowSchema *other_schema);

Parameters

schema

A GArrowSchema.

 

other_schema

A GArrowSchema to be compared.

 

Returns

TRUE if both of them have the same data, FALSE otherwise.

Since: 0.4.0


garrow_schema_get_field ()

GArrowField *
garrow_schema_get_field (GArrowSchema *schema,
                         guint i);

Parameters

schema

A GArrowSchema.

 

i

The index of the target field.

 

Returns

The i-th field of the schema.

[transfer full]


garrow_schema_get_field_by_name ()

GArrowField *
garrow_schema_get_field_by_name (GArrowSchema *schema,
                                 const gchar *name);

Parameters

schema

A GArrowSchema.

 

name

The name of the field to be found.

 

Returns

The found field or NULL.

[transfer full]


garrow_schema_get_field_index ()

gint
garrow_schema_get_field_index (GArrowSchema *schema,
                               const gchar *name);

Parameters

schema

A GArrowSchema.

 

name

The name of the field to be found.

 

Returns

The index of the found field, -1 on not found.

Since: 0.15.0


garrow_schema_n_fields ()

guint
garrow_schema_n_fields (GArrowSchema *schema);

Parameters

schema

A GArrowSchema.

 

Returns

The number of fields of the schema.


garrow_schema_get_fields ()

GList *
garrow_schema_get_fields (GArrowSchema *schema);

Parameters

schema

A GArrowSchema.

 

Returns

The fields of the schema.

[element-type GArrowField][transfer full]


garrow_schema_to_string ()

gchar *
garrow_schema_to_string (GArrowSchema *schema);

Parameters

schema

A GArrowSchema.

 

Returns

The string representation of the schema.


garrow_schema_to_string_metadata ()

gchar *
garrow_schema_to_string_metadata (GArrowSchema *schema,
                                  gboolean show_metadata);

Parameters

schema

A GArrowSchema.

 

show_metadata

Whether include metadata or not.

 

Returns

The string representation of the schema.

It should be freed with g_free() when no longer needed.

Since: 0.17.0


garrow_schema_add_field ()

GArrowSchema *
garrow_schema_add_field (GArrowSchema *schema,
                         guint i,
                         GArrowField *field,
                         GError **error);

Parameters

schema

A GArrowSchema.

 

i

The index of the new field.

 

field

The field to be added.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The newly allocated GArrowSchema that has a new field or NULL on error.

[nullable][transfer full]

Since: 0.10.0


garrow_schema_remove_field ()

GArrowSchema *
garrow_schema_remove_field (GArrowSchema *schema,
                            guint i,
                            GError **error);

Parameters

schema

A GArrowSchema.

 

i

The index of the field to be removed.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The newly allocated GArrowSchema that doesn't have the field or NULL on error.

[nullable][transfer full]

Since: 0.10.0


garrow_schema_replace_field ()

GArrowSchema *
garrow_schema_replace_field (GArrowSchema *schema,
                             guint i,
                             GArrowField *field,
                             GError **error);

Parameters

schema

A GArrowSchema.

 

i

The index of the field to be replaced.

 

field

The newly added GArrowField.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The newly allocated GArrowSchema that has field as the i -th field or NULL on error.

[nullable][transfer full]

Since: 0.10.0


garrow_schema_has_metadata ()

gboolean
garrow_schema_has_metadata (GArrowSchema *schema);

Parameters

schema

A GArrowSchema.

 

Returns

TRUE if the schema has metadata, FALSE otherwise.

Since: 3.0.0


garrow_schema_get_metadata ()

GHashTable *
garrow_schema_get_metadata (GArrowSchema *schema);

Parameters

schema

A GArrowSchema.

 

Returns

The metadata in the schema.

It should be freed with g_hash_table_unref() when no longer needed.

[element-type utf8 utf8][nullable][transfer full]

Since: 0.17.0


garrow_schema_with_metadata ()

GArrowSchema *
garrow_schema_with_metadata (GArrowSchema *schema,
                             GHashTable *metadata);

Parameters

schema

A GArrowSchema.

 

metadata

A new associated metadata.

[element-type utf8 utf8]

Returns

The new schema with the given metadata.

[transfer full]

Since: 0.17.0

Types and Values

GARROW_TYPE_SCHEMA

#define GARROW_TYPE_SCHEMA (garrow_schema_get_type())

struct GArrowSchemaClass

struct GArrowSchemaClass {
  GObjectClass parent_class;
};

GArrowSchema

typedef struct _GArrowSchema GArrowSchema;

Property Details

The “schema” property

  “schema”                   gpointer

The raw std::shared<arrow::Schema> *.

Owner: GArrowSchema

Flags: Write / Construct Only