1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#pragma once
#include <arrow-glib/gobject-type.h>
#include <arrow-glib/record-batch.h>
#include <arrow-glib/schema.h>
#include <arrow-glib/table.h>
#include <arrow-glib/input-stream.h>
#include <arrow-glib/metadata-version.h>
G_BEGIN_DECLS
#define GARROW_TYPE_RECORD_BATCH_READER (garrow_record_batch_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowRecordBatchReader,
garrow_record_batch_reader,
GARROW,
RECORD_BATCH_READER,
GObject)
struct _GArrowRecordBatchReaderClass
{
GObjectClass parent_class;
};
GARROW_AVAILABLE_IN_6_0
GArrowRecordBatchReader *
garrow_record_batch_reader_import(gpointer c_abi_array_stream,
GError **error);
GARROW_AVAILABLE_IN_6_0
GArrowRecordBatchReader *
garrow_record_batch_reader_new(GList *record_batches,
GArrowSchema *schema,
GError **error);
GARROW_AVAILABLE_IN_6_0
gpointer
garrow_record_batch_reader_export(GArrowRecordBatchReader *reader,
GError **error);
GArrowSchema *garrow_record_batch_reader_get_schema(
GArrowRecordBatchReader *reader);
#ifndef GARROW_DISABLE_DEPRECATED
G_GNUC_DEPRECATED_FOR(garrow_record_batch_reader_read_next)
GArrowRecordBatch *garrow_record_batch_reader_get_next_record_batch(
GArrowRecordBatchReader *reader,
GError **error);
#endif
#ifndef GARROW_DISABLE_DEPRECATED
G_GNUC_DEPRECATED_FOR(garrow_record_batch_reader_read_next)
GArrowRecordBatch *garrow_record_batch_reader_read_next_record_batch(
GArrowRecordBatchReader *reader,
GError **error);
#endif
GArrowRecordBatch *garrow_record_batch_reader_read_next(
GArrowRecordBatchReader *reader,
GError **error);
GARROW_AVAILABLE_IN_6_0
GArrowTable *
garrow_record_batch_reader_read_all(GArrowRecordBatchReader *reader,
GError **error);
#define GARROW_TYPE_TABLE_BATCH_READER (garrow_table_batch_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowTableBatchReader,
garrow_table_batch_reader,
GARROW,
TABLE_BATCH_READER,
GArrowRecordBatchReader)
struct _GArrowTableBatchReaderClass
{
GArrowRecordBatchReaderClass parent_class;
};
GArrowTableBatchReader *garrow_table_batch_reader_new(GArrowTable *table);
#define GARROW_TYPE_RECORD_BATCH_STREAM_READER \
(garrow_record_batch_stream_reader_get_type())
#define GARROW_RECORD_BATCH_STREAM_READER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
GARROW_TYPE_RECORD_BATCH_STREAM_READER, \
GArrowRecordBatchStreamReader))
#define GARROW_RECORD_BATCH_STREAM_READER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GARROW_TYPE_RECORD_BATCH_STREAM_READER, \
GArrowRecordBatchStreamReaderClass))
#define GARROW_IS_RECORD_BATCH_STREAM_READER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), \
GARROW_TYPE_RECORD_BATCH_STREAM_READER))
#define GARROW_IS_RECORD_BATCH_STREAM_READER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), \
GARROW_TYPE_RECORD_BATCH_STREAM_READER))
#define GARROW_RECORD_BATCH_STREAM_READER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), \
GARROW_TYPE_RECORD_BATCH_STREAM_READER, \
GArrowRecordBatchStreamReaderClass))
typedef struct _GArrowRecordBatchStreamReader GArrowRecordBatchStreamReader;
#ifndef __GTK_DOC_IGNORE__
typedef struct _GArrowRecordBatchStreamReaderClass GArrowRecordBatchStreamReaderClass;
#endif
/**
* GArrowRecordBatchStreamReader:
*
* It wraps `arrow::ipc::RecordBatchStreamReader`.
*/
struct _GArrowRecordBatchStreamReader
{
/*< private >*/
GArrowRecordBatchReader parent_instance;
};
#ifndef __GTK_DOC_IGNORE__
struct _GArrowRecordBatchStreamReaderClass
{
GArrowRecordBatchReaderClass parent_class;
};
#endif
GType garrow_record_batch_stream_reader_get_type(void) G_GNUC_CONST;
GArrowRecordBatchStreamReader *garrow_record_batch_stream_reader_new(
GArrowInputStream *stream,
GError **error);
#define GARROW_TYPE_RECORD_BATCH_FILE_READER \
(garrow_record_batch_file_reader_get_type())
#define GARROW_RECORD_BATCH_FILE_READER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
GARROW_TYPE_RECORD_BATCH_FILE_READER, \
GArrowRecordBatchFileReader))
#define GARROW_RECORD_BATCH_FILE_READER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GARROW_TYPE_RECORD_BATCH_FILE_READER, \
GArrowRecordBatchFileReaderClass))
#define GARROW_IS_RECORD_BATCH_FILE_READER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), \
GARROW_TYPE_RECORD_BATCH_FILE_READER))
#define GARROW_IS_RECORD_BATCH_FILE_READER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), \
GARROW_TYPE_RECORD_BATCH_FILE_READER))
#define GARROW_RECORD_BATCH_FILE_READER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), \
GARROW_TYPE_RECORD_BATCH_FILE_READER, \
GArrowRecordBatchFileReaderClass))
typedef struct _GArrowRecordBatchFileReader GArrowRecordBatchFileReader;
#ifndef __GTK_DOC_IGNORE__
typedef struct _GArrowRecordBatchFileReaderClass GArrowRecordBatchFileReaderClass;
#endif
/**
* GArrowRecordBatchFileReader:
*
* It wraps `arrow::ipc::RecordBatchFileReader`.
*/
struct _GArrowRecordBatchFileReader
{
/*< private >*/
GObject parent_instance;
};
#ifndef __GTK_DOC_IGNORE__
struct _GArrowRecordBatchFileReaderClass
{
GObjectClass parent_class;
};
#endif
GType garrow_record_batch_file_reader_get_type(void) G_GNUC_CONST;
GArrowRecordBatchFileReader *garrow_record_batch_file_reader_new(
GArrowSeekableInputStream *file,
GError **error);
GArrowSchema *garrow_record_batch_file_reader_get_schema(
GArrowRecordBatchFileReader *reader);
guint garrow_record_batch_file_reader_get_n_record_batches(
GArrowRecordBatchFileReader *reader);
GArrowMetadataVersion garrow_record_batch_file_reader_get_version(
GArrowRecordBatchFileReader *reader);
#ifndef GARROW_DISABLE_DEPRECATED
G_GNUC_DEPRECATED_FOR(garrow_record_batch_file_reader_read_record_batch)
GArrowRecordBatch *garrow_record_batch_file_reader_get_record_batch(
GArrowRecordBatchFileReader *reader,
guint i,
GError **error);
#endif
GArrowRecordBatch *garrow_record_batch_file_reader_read_record_batch(
GArrowRecordBatchFileReader *reader,
guint i,
GError **error);
#define GARROW_TYPE_FEATHER_FILE_READER (garrow_feather_file_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowFeatherFileReader,
garrow_feather_file_reader,
GARROW,
FEATHER_FILE_READER,
GObject)
struct _GArrowFeatherFileReaderClass
{
GObjectClass parent_class;
};
GArrowFeatherFileReader *garrow_feather_file_reader_new(
GArrowSeekableInputStream *file,
GError **error);
gint garrow_feather_file_reader_get_version(
GArrowFeatherFileReader *reader);
GArrowTable *
garrow_feather_file_reader_read(GArrowFeatherFileReader *reader,
GError **error);
GArrowTable *
garrow_feather_file_reader_read_indices(GArrowFeatherFileReader *reader,
const gint *indices,
guint n_indices,
GError **error);
GArrowTable *
garrow_feather_file_reader_read_names(GArrowFeatherFileReader *reader,
const gchar **names,
guint n_names,
GError **error);
#define GARROW_TYPE_CSV_READ_OPTIONS (garrow_csv_read_options_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowCSVReadOptions,
garrow_csv_read_options,
GARROW,
CSV_READ_OPTIONS,
GObject)
struct _GArrowCSVReadOptionsClass
{
GObjectClass parent_class;
};
GArrowCSVReadOptions *garrow_csv_read_options_new(void);
void
garrow_csv_read_options_add_column_type(GArrowCSVReadOptions *options,
const gchar *name,
GArrowDataType *data_type);
void
garrow_csv_read_options_add_schema(GArrowCSVReadOptions *options,
GArrowSchema *schema);
GHashTable *
garrow_csv_read_options_get_column_types(GArrowCSVReadOptions *options);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_set_null_values(GArrowCSVReadOptions *options,
const gchar **null_values,
gsize n_null_values);
GARROW_AVAILABLE_IN_0_14
gchar **
garrow_csv_read_options_get_null_values(GArrowCSVReadOptions *options);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_add_null_value(GArrowCSVReadOptions *options,
const gchar *null_value);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_set_true_values(GArrowCSVReadOptions *options,
const gchar **true_values,
gsize n_true_values);
GARROW_AVAILABLE_IN_0_14
gchar **
garrow_csv_read_options_get_true_values(GArrowCSVReadOptions *options);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_add_true_value(GArrowCSVReadOptions *options,
const gchar *true_value);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_set_false_values(GArrowCSVReadOptions *options,
const gchar **false_values,
gsize n_false_values);
GARROW_AVAILABLE_IN_0_14
gchar **
garrow_csv_read_options_get_false_values(GArrowCSVReadOptions *options);
GARROW_AVAILABLE_IN_0_14
void
garrow_csv_read_options_add_false_value(GArrowCSVReadOptions *options,
const gchar *false_value);
GARROW_AVAILABLE_IN_0_15
void
garrow_csv_read_options_set_column_names(GArrowCSVReadOptions *options,
const gchar **column_names,
gsize n_column_names);
GARROW_AVAILABLE_IN_0_15
gchar **
garrow_csv_read_options_get_column_names(GArrowCSVReadOptions *options);
GARROW_AVAILABLE_IN_0_15
void
garrow_csv_read_options_add_column_name(GArrowCSVReadOptions *options,
const gchar *column_name);
#define GARROW_TYPE_CSV_READER (garrow_csv_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowCSVReader,
garrow_csv_reader,
GARROW,
CSV_READER,
GObject)
struct _GArrowCSVReaderClass
{
GObjectClass parent_class;
};
GArrowCSVReader *garrow_csv_reader_new(GArrowInputStream *input,
GArrowCSVReadOptions *options,
GError **error);
GArrowTable *garrow_csv_reader_read(GArrowCSVReader *reader,
GError **error);
/**
* GArrowJSONReadUnexpectedFieldBehavior:
* @GARROW_JSON_READ_IGNORE: Ignore other fields.
* @GARROW_JSON_READ_ERROR: Return error.
* @GARROW_JSON_READ_INFER_TYPE: Infer a type.
*
* They are corresponding to `arrow::json::UnexpectedFieldBehavior` values.
*/
typedef enum {
GARROW_JSON_READ_IGNORE,
GARROW_JSON_READ_ERROR,
GARROW_JSON_READ_INFER_TYPE,
} GArrowJSONReadUnexpectedFieldBehavior;
#define GARROW_TYPE_JSON_READ_OPTIONS (garrow_json_read_options_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowJSONReadOptions,
garrow_json_read_options,
GARROW,
JSON_READ_OPTIONS,
GObject)
struct _GArrowJSONReadOptionsClass
{
GObjectClass parent_class;
};
GARROW_AVAILABLE_IN_0_14
GArrowJSONReadOptions *garrow_json_read_options_new(void);
#define GARROW_TYPE_JSON_READER (garrow_json_reader_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowJSONReader,
garrow_json_reader,
GARROW,
JSON_READER,
GObject)
struct _GArrowJSONReaderClass
{
GObjectClass parent_class;
};
GARROW_AVAILABLE_IN_0_14
GArrowJSONReader *garrow_json_reader_new(GArrowInputStream *input,
GArrowJSONReadOptions *options,
GError **error);
GARROW_AVAILABLE_IN_0_14
GArrowTable *garrow_json_reader_read(GArrowJSONReader *reader,
GError **error);
G_END_DECLS
|