Composite array classes

Composite array classes

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GArrowArray
        ├── GArrowDictionaryArray
        ├── GArrowListArray
        ╰── GArrowStructArray

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.

GArrowStructArray is a class for struct array. It can store zero or more structs. One struct has zero or more fields. If you don't have Arrow format data, you need to use GArrowStructArrayBuilder to create a new 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 (gint64 length,
                       GArrowBuffer *value_offsets,
                       GArrowArray *values,
                       GArrowBuffer *null_bitmap,
                       gint64 n_nulls);

Parameters

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_struct_array_new ()

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

Parameters

data_type

The data type of the struct.

 

length

The number of elements.

 

children

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);

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

Use garrow_struct_array_flatten() instead.

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_dictionary_array_new ()

GArrowDictionaryArray *
garrow_dictionary_array_new (GArrowDataType *data_type,
                             GArrowArray *indices);

Parameters

data_type

The data type of dictionary.

 

indices

The indices of values in dictionary.

 

Returns

A newly created GArrowDictionaryArray.

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);

Parameters

array

A GArrowDictionaryArray.

 

Returns

The dictionary data type of this array.

[transfer full]

Since: 0.8.0

Types and Values

struct GArrowListArray

struct GArrowListArray;

It wraps arrow::ListArray.


struct GArrowStructArray

struct GArrowStructArray;

It wraps arrow::StructArray.


GARROW_TYPE_DICTIONARY_ARRAY

#define GARROW_TYPE_DICTIONARY_ARRAY (garrow_dictionary_array_get_type())

struct GArrowDictionaryArrayClass

struct GArrowDictionaryArrayClass {
  GArrowArrayClass parent_class;
};

GArrowDictionaryArray

typedef struct _GArrowDictionaryArray GArrowDictionaryArray;