Composite array classes

Composite array classes

Functions

GArrowListArray * garrow_list_array_new ()
GArrowDataType * garrow_list_array_get_value_type ()
GArrowArray * garrow_list_array_get_value ()
GArrowArray * garrow_list_array_get_values ()
gint32 garrow_list_array_get_value_offset ()
gint32 garrow_list_array_get_value_length ()
const gint32 * garrow_list_array_get_value_offsets ()
GArrowLargeListArray * garrow_large_list_array_new ()
GArrowDataType * garrow_large_list_array_get_value_type ()
GArrowArray * garrow_large_list_array_get_value ()
GArrowArray * garrow_large_list_array_get_values ()
gint64 garrow_large_list_array_get_value_offset ()
gint64 garrow_large_list_array_get_value_length ()
const gint64 * garrow_large_list_array_get_value_offsets ()
GArrowStructArray * garrow_struct_array_new ()
GArrowArray * garrow_struct_array_get_field ()
GList * garrow_struct_array_get_fields ()
GList * garrow_struct_array_flatten ()
GArrowMapArray * garrow_map_array_new ()
GArrowArray * garrow_map_array_get_keys ()
GArrowArray * garrow_map_array_get_items ()
GArrowArray * garrow_union_array_get_field ()
GArrowSparseUnionArray * garrow_sparse_union_array_new ()
GArrowSparseUnionArray * garrow_sparse_union_array_new_data_type ()
GArrowDenseUnionArray * garrow_dense_union_array_new ()
GArrowDenseUnionArray * garrow_dense_union_array_new_data_type ()
GArrowDictionaryArray * garrow_dictionary_array_new ()
GArrowArray * garrow_dictionary_array_get_indices ()
GArrowArray * garrow_dictionary_array_get_dictionary ()
GArrowDictionaryDataType * garrow_dictionary_array_get_dictionary_data_type ()

Properties

GArrowInt32Array * value-offsets Read / Write / Construct Only
GArrowArray * dictionary Read / Write / Construct Only
GArrowArray * indices Read / Write / Construct Only
GArrowArray * raw-values Read / Write / Construct Only
GArrowArray * raw-values Read / Write / Construct Only
GArrowArray * items Read / Write / Construct Only
GArrowArray * keys Read / Write / Construct Only
GArrowArray * offsets Read / Write / Construct Only
GArrowInt8Array * type-ids Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GArrowArray
        ├── GArrowDictionaryArray
        ├── GArrowLargeListArray
        ├── GArrowListArray
           ╰── GArrowMapArray
        ├── GArrowStructArray
        ╰── GArrowUnionArray
            ├── GArrowDenseUnionArray
            ├── GArrowSparseUnionArray
            ├── GArrowDenseUnionArray
            ╰── GArrowSparseUnionArray

Includes

#include <arrow-glib/arrow-glib.h>

Description

GArrowListArray is a class for list array. It can store zero or more list data. If you don't have Arrow format data, you need to use GArrowListArrayBuilder to create a new array.

GArrowLargeListArray is a class for 64-bit offsets list array. It can store zero or more list data. If you don't have Arrow format data, you need to use GArrowLargeListArrayBuilder to create a new array.

GArrowStructArray is a class for struct array. It can store zero or more structs. One struct has one or more fields. If you don't have Arrow format data, you need to use GArrowStructArrayBuilder to create a new array.

GArrowMapArray is a class for map array. It can store data with keys and items.

GArrowUnionArray is a base class for union array. It can store zero or more unions. One union has one or more fields but one union can store only one field value.

GArrowDenseUnionArray is a class for dense union array.

GArrowSparseUnionArray is a class for sparse union array.

GArrowDictionaryArray is a class for dictionary array. It can store data with dictionary and indices. It's space effective than normal array when the array has many same values. You can convert a normal array to dictionary array by garrow_array_dictionary_encode().

Functions

garrow_list_array_new ()

GArrowListArray *
garrow_list_array_new (GArrowDataType *data_type,
                       gint64 length,
                       GArrowBuffer *value_offsets,
                       GArrowArray *values,
                       GArrowBuffer *null_bitmap,
                       gint64 n_nulls);

Parameters

data_type

The data type of the list.

 

length

The number of elements.

 

value_offsets

The offsets of values in Arrow format.

 

values

The values as GArrowArray.

 

null_bitmap

The bitmap that shows null elements. The N-th element is null when the N-th bit is 0, not null otherwise. If the array has no null elements, the bitmap must be NULL and n_nulls is 0.

[nullable]

n_nulls

The number of null elements. If -1 is specified, the number of nulls are computed from null_bitmap .

 

Returns

A newly created GArrowListArray.

Since: 0.4.0


garrow_list_array_get_value_type ()

GArrowDataType *
garrow_list_array_get_value_type (GArrowListArray *array);

Parameters

array

A GArrowListArray.

 

Returns

The data type of value in each list.

[transfer full]


garrow_list_array_get_value ()

GArrowArray *
garrow_list_array_get_value (GArrowListArray *array,
                             gint64 i);

Parameters

array

A GArrowListArray.

 

i

The index of the target value.

 

Returns

The i-th list.

[transfer full]


garrow_list_array_get_values ()

GArrowArray *
garrow_list_array_get_values (GArrowListArray *array);

Parameters

array

A GArrowListArray.

 

Returns

The array containing the list's values.

[transfer full]

Since: 2.0.0


garrow_list_array_get_value_offset ()

gint32
garrow_list_array_get_value_offset (GArrowListArray *array,
                                    gint64 i);

garrow_list_array_get_value_length ()

gint32
garrow_list_array_get_value_length (GArrowListArray *array,
                                    gint64 i);

Parameters

array

A GArrowListArray.

 

i

The index of the length of the target value.

 

Returns

The target length in the array containing the list's values.

Since: 2.0.0


garrow_list_array_get_value_offsets ()

const gint32 *
garrow_list_array_get_value_offsets (GArrowListArray *array,
                                     gint64 *n_offsets);

Parameters

array

A GArrowListArray.

 

n_offsets

The number of offsets to be returned.

 

Returns

The target offsets in the array containing the list's values.

[array length=n_offsets]

Since: 2.0.0


garrow_large_list_array_new ()

GArrowLargeListArray *
garrow_large_list_array_new (GArrowDataType *data_type,
                             gint64 length,
                             GArrowBuffer *value_offsets,
                             GArrowArray *values,
                             GArrowBuffer *null_bitmap,
                             gint64 n_nulls);

Parameters

data_type

The data type of the list.

 

length

The number of elements.

 

value_offsets

The offsets of values in Arrow format.

 

values

The values as GArrowArray.

 

null_bitmap

The bitmap that shows null elements. The N-th element is null when the N-th bit is 0, not null otherwise. If the array has no null elements, the bitmap must be NULL and n_nulls is 0.

[nullable]

n_nulls

The number of null elements. If -1 is specified, the number of nulls are computed from null_bitmap .

 

Returns

A newly created GArrowLargeListArray.

Since: 0.16.0


garrow_large_list_array_get_value_type ()

GArrowDataType *
garrow_large_list_array_get_value_type
                               (GArrowLargeListArray *array);

Parameters

array

A GArrowLargeListArray.

 

Returns

The data type of value in each list.

[transfer full]

Since: 0.16.0


garrow_large_list_array_get_value ()

GArrowArray *
garrow_large_list_array_get_value (GArrowLargeListArray *array,
                                   gint64 i);

Parameters

array

A GArrowLargeListArray.

 

i

The index of the target value.

 

Returns

The i -th list.

[transfer full]

Since: 0.16.0


garrow_large_list_array_get_values ()

GArrowArray *
garrow_large_list_array_get_values (GArrowLargeListArray *array);

Parameters

array

A GArrowLargeListArray.

 

Returns

The array containing the list's values.

[transfer full]

Since: 2.0.0


garrow_large_list_array_get_value_offset ()

gint64
garrow_large_list_array_get_value_offset
                               (GArrowLargeListArray *array,
                                gint64 i);

Parameters

array

A GArrowLargeListArray.

 

i

The index of the offset of the target value.

 

Returns

The target offset in the array containing the list's values.

Since: 2.0.0


garrow_large_list_array_get_value_length ()

gint64
garrow_large_list_array_get_value_length
                               (GArrowLargeListArray *array,
                                gint64 i);

garrow_large_list_array_get_value_offsets ()

const gint64 *
garrow_large_list_array_get_value_offsets
                               (GArrowLargeListArray *array,
                                gint64 *n_offsets);

Parameters

array

A GArrowLargeListArray.

 

n_offsets

The number of offsets to be returned.

 

Returns

The target offsets in the array containing the list's values.

[array length=n_offsets]

Since: 2.0.0


garrow_struct_array_new ()

GArrowStructArray *
garrow_struct_array_new (GArrowDataType *data_type,
                         gint64 length,
                         GList *fields,
                         GArrowBuffer *null_bitmap,
                         gint64 n_nulls);

Parameters

data_type

The data type of the struct.

 

length

The number of elements.

 

fields

The arrays for each field as GList of GArrowArray.

[element-type GArrowArray]

null_bitmap

The bitmap that shows null elements. The N-th element is null when the N-th bit is 0, not null otherwise. If the array has no null elements, the bitmap must be NULL and n_nulls is 0.

[nullable]

n_nulls

The number of null elements. If -1 is specified, the number of nulls are computed from null_bitmap .

 

Returns

A newly created GArrowStructArray.

Since: 0.4.0


garrow_struct_array_get_field ()

GArrowArray *
garrow_struct_array_get_field (GArrowStructArray *array,
                               gint i);

Parameters

array

A GArrowStructArray.

 

i

The index of the field in the struct.

 

Returns

The i-th field.

[transfer full]


garrow_struct_array_get_fields ()

GList *
garrow_struct_array_get_fields (GArrowStructArray *array);

Parameters

array

A GArrowStructArray.

 

Returns

The fields in the struct.

[element-type GArrowArray][transfer full]


garrow_struct_array_flatten ()

GList *
garrow_struct_array_flatten (GArrowStructArray *array,
                             GError **error);

Parameters

array

A GArrowStructArray.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The fields in the struct.

[element-type GArrowArray][transfer full]

Since: 0.10.0


garrow_map_array_new ()

GArrowMapArray *
garrow_map_array_new (GArrowArray *offsets,
                      GArrowArray *keys,
                      GArrowArray *items,
                      GError **error);

Parameters

offsets

The offsets Array containing n + 1 offsets encoding length and size.

 

keys

The Array containing key values.

 

items

The items Array containing item values.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowMapArray or NULL on error.

[nullable]

Since: 0.17.0


garrow_map_array_get_keys ()

GArrowArray *
garrow_map_array_get_keys (GArrowMapArray *array);

Parameters

array

A GArrowMapArray.

 

Returns

The Array containing key values.

[transfer full]

Since: 0.17.0


garrow_map_array_get_items ()

GArrowArray *
garrow_map_array_get_items (GArrowMapArray *array);

Parameters

array

A GArrowMapArray.

 

Returns

The items Array containing item values.

[transfer full]

Since: 0.17.0


garrow_union_array_get_field ()

GArrowArray *
garrow_union_array_get_field (GArrowUnionArray *array,
                              gint i);

Parameters

array

A GArrowUnionArray.

 

i

The index of the field in the union.

 

Returns

The i-th field values as a GArrowArray or NULL on out of range.

[nullable][transfer full]


garrow_sparse_union_array_new ()

GArrowSparseUnionArray *
garrow_sparse_union_array_new (GArrowInt8Array *type_ids,
                               GList *fields,
                               GError **error);

Parameters

type_ids

The field type IDs for each value as GArrowInt8Array.

 

fields

The arrays for each field as GList of GArrowArray.

[element-type GArrowArray]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowSparseUnionArray or NULL on error.

[nullable]

Since: 0.12.0


garrow_sparse_union_array_new_data_type ()

GArrowSparseUnionArray *
garrow_sparse_union_array_new_data_type
                               (GArrowSparseUnionDataType *data_type,
                                GArrowInt8Array *type_ids,
                                GList *fields,
                                GError **error);

Parameters

data_type

The data type for the sparse array.

 

type_ids

The field type IDs for each value as GArrowInt8Array.

 

fields

The arrays for each field as GList of GArrowArray.

[element-type GArrowArray]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowSparseUnionArray or NULL on error.

[nullable]

Since: 0.14.0


garrow_dense_union_array_new ()

GArrowDenseUnionArray *
garrow_dense_union_array_new (GArrowInt8Array *type_ids,
                              GArrowInt32Array *value_offsets,
                              GList *fields,
                              GError **error);

Parameters

type_ids

The field type IDs for each value as GArrowInt8Array.

 

value_offsets

The value offsets for each value as GArrowInt32Array. Each offset is counted for each type.

 

fields

The arrays for each field as GList of GArrowArray.

[element-type GArrowArray]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowDenseUnionArray or NULL on error.

[nullable]

Since: 0.12.0


garrow_dense_union_array_new_data_type ()

GArrowDenseUnionArray *
garrow_dense_union_array_new_data_type
                               (GArrowDenseUnionDataType *data_type,
                                GArrowInt8Array *type_ids,
                                GArrowInt32Array *value_offsets,
                                GList *fields,
                                GError **error);

Parameters

data_type

The data type for the dense array.

 

type_ids

The field type IDs for each value as GArrowInt8Array.

 

value_offsets

The value offsets for each value as GArrowInt32Array. Each offset is counted for each type.

 

fields

The arrays for each field as GList of GArrowArray.

[element-type GArrowArray]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowSparseUnionArray or NULL on error.

[nullable]

Since: 0.14.0


garrow_dictionary_array_new ()

GArrowDictionaryArray *
garrow_dictionary_array_new (GArrowDataType *data_type,
                             GArrowArray *indices,
                             GArrowArray *dictionary,
                             GError **error);

Parameters

data_type

The data type of the dictionary array.

 

indices

The indices of values in dictionary.

 

dictionary

The dictionary of the dictionary array.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowDictionaryArray or NULL on error.

[nullable]

Since: 0.8.0


garrow_dictionary_array_get_indices ()

GArrowArray *
garrow_dictionary_array_get_indices (GArrowDictionaryArray *array);

Parameters

array

A GArrowDictionaryArray.

 

Returns

The indices of values in dictionary.

[transfer full]

Since: 0.8.0


garrow_dictionary_array_get_dictionary ()

GArrowArray *
garrow_dictionary_array_get_dictionary
                               (GArrowDictionaryArray *array);

Parameters

array

A GArrowDictionaryArray.

 

Returns

The dictionary of this array.

[transfer full]

Since: 0.8.0


garrow_dictionary_array_get_dictionary_data_type ()

GArrowDictionaryDataType *
garrow_dictionary_array_get_dictionary_data_type
                               (GArrowDictionaryArray *array);

garrow_dictionary_array_get_dictionary_data_type has been deprecated since version 1.0.0 and should not be used in newly-written code.

Use garrow_array_get_value_data_type() instead.

Parameters

array

A GArrowDictionaryArray.

 

Returns

The dictionary data type of this array.

[transfer full]

Since: 0.8.0

Types and Values

GARROW_TYPE_LIST_ARRAY

#define GARROW_TYPE_LIST_ARRAY (garrow_list_array_get_type())

struct GArrowListArrayClass

struct GArrowListArrayClass {
  GArrowArrayClass parent_class;
};

GARROW_TYPE_LARGE_LIST_ARRAY

#define GARROW_TYPE_LARGE_LIST_ARRAY (garrow_large_list_array_get_type())

struct GArrowLargeListArrayClass

struct GArrowLargeListArrayClass {
  GArrowArrayClass parent_class;
};

GARROW_TYPE_STRUCT_ARRAY

#define GARROW_TYPE_STRUCT_ARRAY (garrow_struct_array_get_type())

struct GArrowStructArrayClass

struct GArrowStructArrayClass {
  GArrowArrayClass parent_class;
};

GARROW_TYPE_MAP_ARRAY

#define GARROW_TYPE_MAP_ARRAY (garrow_map_array_get_type())

struct GArrowMapArrayClass

struct GArrowMapArrayClass {
  GArrowListArrayClass parent_class;
};

GARROW_TYPE_UNION_ARRAY

#define GARROW_TYPE_UNION_ARRAY (garrow_union_array_get_type())

struct GArrowUnionArrayClass

struct GArrowUnionArrayClass {
  GArrowArrayClass parent_class;
};

GARROW_TYPE_SPARSE_UNION_ARRAY

#define GARROW_TYPE_SPARSE_UNION_ARRAY (garrow_sparse_union_array_get_type())

struct GArrowSparseUnionArrayClass

struct GArrowSparseUnionArrayClass {
  GArrowUnionArrayClass parent_class;
};

GARROW_TYPE_DENSE_UNION_ARRAY

#define GARROW_TYPE_DENSE_UNION_ARRAY (garrow_dense_union_array_get_type())

struct GArrowDenseUnionArrayClass

struct GArrowDenseUnionArrayClass {
  GArrowUnionArrayClass parent_class;
};

GARROW_TYPE_DICTIONARY_ARRAY

#define GARROW_TYPE_DICTIONARY_ARRAY (garrow_dictionary_array_get_type())

struct GArrowDictionaryArrayClass

struct GArrowDictionaryArrayClass {
  GArrowArrayClass parent_class;
};

GArrowDenseUnionArray

typedef struct _GArrowDenseUnionArray GArrowDenseUnionArray;

GArrowDictionaryArray

typedef struct _GArrowDictionaryArray GArrowDictionaryArray;

GArrowLargeListArray

typedef struct _GArrowLargeListArray GArrowLargeListArray;

GArrowListArray

typedef struct _GArrowListArray GArrowListArray;

GArrowMapArray

typedef struct _GArrowMapArray GArrowMapArray;

GArrowSparseUnionArray

typedef struct _GArrowSparseUnionArray GArrowSparseUnionArray;

GArrowStructArray

typedef struct _GArrowStructArray GArrowStructArray;

GArrowUnionArray

typedef struct _GArrowUnionArray GArrowUnionArray;

Property Details

The “value-offsets” property

  “value-offsets”            GArrowInt32Array *

The GArrowInt32Array for value offsets.

Owner: GArrowDenseUnionArray

Flags: Read / Write / Construct Only


The “dictionary” property

  “dictionary”               GArrowArray *

The GArrowArray for dictionary.

Owner: GArrowDictionaryArray

Flags: Read / Write / Construct Only


The “indices” property

  “indices”                  GArrowArray *

The GArrowArray for indices.

Owner: GArrowDictionaryArray

Flags: Read / Write / Construct Only


The “raw-values” property

  “raw-values”               GArrowArray *

The raw values.

Owner: GArrowLargeListArray

Flags: Read / Write / Construct Only


The “raw-values” property

  “raw-values”               GArrowArray *

The raw values.

Owner: GArrowListArray

Flags: Read / Write / Construct Only


The “items” property

  “items”                    GArrowArray *

The GArrowArray for items.

Owner: GArrowMapArray

Flags: Read / Write / Construct Only


The “keys” property

  “keys”                     GArrowArray *

The GArrowArray for keys.

Owner: GArrowMapArray

Flags: Read / Write / Construct Only


The “offsets” property

  “offsets”                  GArrowArray *

The GArrowArray for offsets.

Owner: GArrowMapArray

Flags: Read / Write / Construct Only


The “type-ids” property

  “type-ids”                 GArrowInt8Array *

The GArrowInt8Array for type IDs.

Owner: GArrowUnionArray

Flags: Read / Write / Construct Only