Reader classes

Reader classes

Functions

Properties

gpointer record-batch-reader Write / Construct Only
gpointer record-batch-file-reader Write / Construct Only
gpointer feather-table-reader Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ├── GArrowFeatherFileReader
    ├── GArrowRecordBatchFileReader
    ├── GArrowRecordBatchReader
       ╰── GArrowRecordBatchStreamReader
    ╰── GArrowRecordBatchReader
        ╰── GArrowRecordBatchStreamReader

Includes

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

Description

GArrowRecordBatchReader is a base class for reading record batches in stream format from input.

GArrowRecordBatchStreamReader is a class for reading record batches in stream format from input synchronously.

GArrowRecordBatchFileReader is a class for reading record batches in file format from input.

GArrowFeatherFileReader is a class for reading columns in Feather file format from input.

Functions

garrow_record_batch_reader_get_schema ()

GArrowSchema *
garrow_record_batch_reader_get_schema (GArrowRecordBatchReader *reader);

Parameters

Returns

The schema in the stream.

[transfer full]

Since 0.4.0


garrow_record_batch_reader_get_next_record_batch ()

GArrowRecordBatch *
garrow_record_batch_reader_get_next_record_batch
                               (GArrowRecordBatchReader *reader,
                                GError **error);

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

Use garrow_record_batch_reader_read_next_record_batch() instead.

Parameters

reader

A GArrowRecordBatchReader.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The next record batch in the stream or NULL on end of stream.

[nullable][transfer full]

Since 0.4.0


garrow_record_batch_reader_read_next_record_batch ()

GArrowRecordBatch *
garrow_record_batch_reader_read_next_record_batch
                               (GArrowRecordBatchReader *reader,
                                GError **error);

Parameters

reader

A GArrowRecordBatchReader.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The next record batch in the stream or NULL on end of stream.

[nullable][transfer full]

Since 0.5.0


garrow_record_batch_stream_reader_new ()

GArrowRecordBatchStreamReader *
garrow_record_batch_stream_reader_new (GArrowInputStream *stream,
                                       GError **error);

Parameters

stream

The stream to be read.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

A newly created GArrowRecordBatchStreamReader or NULL on error.

[nullable]

Since 0.4.0


garrow_record_batch_file_reader_new ()

GArrowRecordBatchFileReader *
garrow_record_batch_file_reader_new (GArrowSeekableInputStream *file,
                                     GError **error);

Parameters

file

The file to be read.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

A newly created GArrowRecordBatchFileReader or NULL on error.

[nullable]

Since 0.4.0


garrow_record_batch_file_reader_get_schema ()

GArrowSchema *
garrow_record_batch_file_reader_get_schema
                               (GArrowRecordBatchFileReader *reader);

Parameters

Returns

The schema in the file.

[transfer full]

Since 0.4.0


garrow_record_batch_file_reader_get_n_record_batches ()

guint
garrow_record_batch_file_reader_get_n_record_batches
                               (GArrowRecordBatchFileReader *reader);

Parameters

Returns

The number of record batches in the file.

Since 0.4.0


garrow_record_batch_file_reader_get_version ()

GArrowMetadataVersion
garrow_record_batch_file_reader_get_version
                               (GArrowRecordBatchFileReader *reader);

Parameters

Returns

The format version in the file.

Since 0.4.0


garrow_record_batch_file_reader_get_record_batch ()

GArrowRecordBatch *
garrow_record_batch_file_reader_get_record_batch
                               (GArrowRecordBatchFileReader *reader,
                                guint i,
                                GError **error);

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

Use garrow_record_batch_file_reader_read_record_batch() instead.

Parameters

reader

A GArrowRecordBatchFileReader.

 

i

The index of the target record batch.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The i-th record batch in the file or NULL on error.

[nullable][transfer full]

Since 0.4.0


garrow_record_batch_file_reader_read_record_batch ()

GArrowRecordBatch *
garrow_record_batch_file_reader_read_record_batch
                               (GArrowRecordBatchFileReader *reader,
                                guint i,
                                GError **error);

Parameters

reader

A GArrowRecordBatchFileReader.

 

i

The index of the target record batch.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The i-th record batch in the file or NULL on error.

[nullable][transfer full]

Since 0.5.0


garrow_feather_file_reader_new ()

GArrowFeatherFileReader *
garrow_feather_file_reader_new (GArrowSeekableInputStream *file,
                                GError **error);

Parameters

file

The file to be read.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

A newly created GArrowFeatherFileReader or NULL on error.

[nullable]

Since 0.4.0


garrow_feather_file_reader_get_description ()

gchar *
garrow_feather_file_reader_get_description
                               (GArrowFeatherFileReader *reader);

Parameters

Returns

The description of the file if it exists, NULL otherwise. You can confirm whether description exists or not by garrow_feather_file_reader_has_description(). It should be freed with g_free() when no longer needed.

[nullable]

Since 0.4.0


garrow_feather_file_reader_has_description ()

gboolean
garrow_feather_file_reader_has_description
                               (GArrowFeatherFileReader *reader);

Parameters

Returns

Whether the file has description or not.

Since 0.4.0


garrow_feather_file_reader_get_version ()

gint
garrow_feather_file_reader_get_version
                               (GArrowFeatherFileReader *reader);

Parameters

Returns

The format version of the file.

Since 0.4.0


garrow_feather_file_reader_get_n_rows ()

gint64
garrow_feather_file_reader_get_n_rows (GArrowFeatherFileReader *reader);

Parameters

Returns

The number of rows in the file.

Since 0.4.0


garrow_feather_file_reader_get_n_columns ()

gint64
garrow_feather_file_reader_get_n_columns
                               (GArrowFeatherFileReader *reader);

Parameters

Returns

The number of columns in the file.

Since 0.4.0


garrow_feather_file_reader_get_column_name ()

gchar *
garrow_feather_file_reader_get_column_name
                               (GArrowFeatherFileReader *reader,
                                gint i);

Parameters

reader

A GArrowFeatherFileReader.

 

i

The index of the target column.

 

Returns

The i-th column name in the file. It should be freed with g_free() when no longer needed.

Since 0.4.0


garrow_feather_file_reader_get_column ()

GArrowColumn *
garrow_feather_file_reader_get_column (GArrowFeatherFileReader *reader,
                                       gint i,
                                       GError **error);

Parameters

reader

A GArrowFeatherFileReader.

 

i

The index of the target column.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The i-th column in the file or NULL on error.

[nullable][transfer full]

Since 0.4.0


garrow_feather_file_reader_get_columns ()

GList *
garrow_feather_file_reader_get_columns
                               (GArrowFeatherFileReader *reader,
                                GError **error);

Parameters

reader

A GArrowFeatherFileReader.

 

error

Return locatipcn for a GError or NULL.

[nullable]

Returns

The columns in the file.

[element-type GArrowColumn][transfer full]

Since 0.4.0

Types and Values

struct GArrowRecordBatchReader

struct GArrowRecordBatchReader;

It wraps arrow::ipc::RecordBatchReader.


struct GArrowRecordBatchStreamReader

struct GArrowRecordBatchStreamReader;

It wraps arrow::ipc::RecordBatchStreamReader.


struct GArrowRecordBatchFileReader

struct GArrowRecordBatchFileReader;

It wraps arrow::ipc::RecordBatchFileReader.


struct GArrowFeatherFileReader

struct GArrowFeatherFileReader;

It wraps arrow::ipc::feather::TableReader.

Property Details

The “record-batch-reader” property

  “record-batch-reader”      gpointer

The raw std::shared<arrow::ipc::RecordBatchRecordBatchReader> *.

Flags: Write / Construct Only


The “record-batch-file-reader” property

  “record-batch-file-reader” gpointer

The raw std::shared<arrow::ipc::RecordBatchFileReader> *.

Flags: Write / Construct Only


The “feather-table-reader” property

  “feather-table-reader”     gpointer

The raw std::shared<arrow::ipc::feather::TableReader> *.

Flags: Write / Construct Only