GArrowField

GArrowField — Field class

Functions

Properties

GArrowDataType * data-type Write / Construct Only
gpointer field Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GArrowField

Description

GArrowField is a class for field. Field is metadata of a column. It has name, data type (GArrowDataType) and nullable information of the column.

Functions

garrow_field_import ()

GArrowField *
garrow_field_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 GArrowField 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_field_new ()

GArrowField *
garrow_field_new (const gchar *name,
                  GArrowDataType *data_type);

Parameters

name

The name of the field.

 

data_type

The data type of the field.

 

Returns

A newly created GArrowField.


garrow_field_new_full ()

GArrowField *
garrow_field_new_full (const gchar *name,
                       GArrowDataType *data_type,
                       gboolean nullable);

Parameters

name

The name of the field.

 

data_type

The data type of the field.

 

nullable

Whether null may be included or not.

 

Returns

A newly created GArrowField.


garrow_field_export ()

gpointer
garrow_field_export (GArrowField *field,
                     GError **error);

Parameters

field

A GArrowField.

 

error

Return location for a GError or NULL.

[nullable]

Returns

An exported GArrowField 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_field_get_name ()

const gchar *
garrow_field_get_name (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

The name of the field.


garrow_field_get_data_type ()

GArrowDataType *
garrow_field_get_data_type (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

The data type of the field.

[transfer none]


garrow_field_is_nullable ()

gboolean
garrow_field_is_nullable (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

Whether the filed may include null or not.


garrow_field_equal ()

gboolean
garrow_field_equal (GArrowField *field,
                    GArrowField *other_field);

Parameters

field

A GArrowField.

 

other_field

A GArrowField to be compared.

 

Returns

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


garrow_field_to_string ()

gchar *
garrow_field_to_string (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

The string representation of the field.


garrow_field_to_string_metadata ()

gchar *
garrow_field_to_string_metadata (GArrowField *field,
                                 gboolean show_metadata);

Parameters

field

A GArrowField.

 

show_metadata

Whether include metadata or not.

 

Returns

The string representation of the field.

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

Since: 3.0.0


garrow_field_has_metadata ()

gboolean
garrow_field_has_metadata (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

TRUE if the field has metadata, FALSE otherwise.

Since: 3.0.0


garrow_field_get_metadata ()

GHashTable *
garrow_field_get_metadata (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

The metadata in the field.

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

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

Since: 3.0.0


garrow_field_with_metadata ()

GArrowField *
garrow_field_with_metadata (GArrowField *field,
                            GHashTable *metadata);

Parameters

field

A GArrowField.

 

metadata

A new associated metadata.

[element-type utf8 utf8]

Returns

The new field with the given metadata.

[transfer full]

Since: 3.0.0


garrow_field_with_merged_metadata ()

GArrowField *
garrow_field_with_merged_metadata (GArrowField *field,
                                   GHashTable *metadata);

Parameters

field

A GArrowField.

 

metadata

An additional associated metadata.

[element-type utf8 utf8]

Returns

The new field that also has the given metadata. If both of the existing metadata and the given metadata have the same keys, the values in the given metadata are used.

[transfer full]

Since: 3.0.0


garrow_field_remove_metadata ()

GArrowField *
garrow_field_remove_metadata (GArrowField *field);

Parameters

field

A GArrowField.

 

Returns

The new field that doesn't have metadata.

[transfer full]

Since: 3.0.0

Types and Values

GARROW_TYPE_FIELD

#define GARROW_TYPE_FIELD (garrow_field_get_type())

struct GArrowFieldClass

struct GArrowFieldClass {
  GObjectClass parent_class;
};

GArrowField

typedef struct _GArrowField GArrowField;

Property Details

The “data-type” property

  “data-type”                GArrowDataType *

The data type.

Owner: GArrowField

Flags: Write / Construct Only


The “field” property

  “field”                    gpointer

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

Owner: GArrowField

Flags: Write / Construct Only