summaryrefslogtreecommitdiffstats
path: root/src/arrow/c_glib/arrow-glib/scalar.h
blob: a110d1c5ef6e01410f2e7e21f4ccf1733e4b9110 (plain)
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
/*
 * 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/array.h>

G_BEGIN_DECLS

typedef struct _GArrowCastOptions GArrowCastOptions;

#define GARROW_TYPE_SCALAR (garrow_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowScalar,
                         garrow_scalar,
                         GARROW,
                         SCALAR,
                         GObject)
struct _GArrowScalarClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowScalar *
garrow_scalar_parse(GArrowDataType *data_type,
                    const guint8 *data,
                    gsize size,
                    GError **error);

GARROW_AVAILABLE_IN_5_0
GArrowDataType *
garrow_scalar_get_data_type(GArrowScalar *scalar);
GARROW_AVAILABLE_IN_5_0
gboolean
garrow_scalar_is_valid(GArrowScalar *scalar);
GARROW_AVAILABLE_IN_5_0
gboolean
garrow_scalar_equal(GArrowScalar *scalar,
                    GArrowScalar *other_scalar);
GARROW_AVAILABLE_IN_5_0
gboolean
garrow_scalar_equal_options(GArrowScalar *scalar,
                            GArrowScalar *other_scalar,
                            GArrowEqualOptions *options);
GARROW_AVAILABLE_IN_5_0
gchar *
garrow_scalar_to_string(GArrowScalar *scalar);

GARROW_AVAILABLE_IN_5_0
GArrowScalar *
garrow_scalar_cast(GArrowScalar *scalar,
                   GArrowDataType *data_type,
                   GArrowCastOptions *options,
                   GError **error);


#define GARROW_TYPE_NULL_SCALAR (garrow_null_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowNullScalar,
                         garrow_null_scalar,
                         GARROW,
                         NULL_SCALAR,
                         GArrowScalar)
struct _GArrowNullScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowNullScalar *
garrow_null_scalar_new(void);


#define GARROW_TYPE_BOOLEAN_SCALAR (garrow_boolean_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowBooleanScalar,
                         garrow_boolean_scalar,
                         GARROW,
                         BOOLEAN_SCALAR,
                         GArrowScalar)
struct _GArrowBooleanScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowBooleanScalar *
garrow_boolean_scalar_new(gboolean value);
GARROW_AVAILABLE_IN_5_0
gboolean
garrow_boolean_scalar_get_value(GArrowBooleanScalar *scalar);


#define GARROW_TYPE_INT8_SCALAR (garrow_int8_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowInt8Scalar,
                         garrow_int8_scalar,
                         GARROW,
                         INT8_SCALAR,
                         GArrowScalar)
struct _GArrowInt8ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowInt8Scalar *
garrow_int8_scalar_new(gint8 value);
GARROW_AVAILABLE_IN_5_0
gint8
garrow_int8_scalar_get_value(GArrowInt8Scalar *scalar);


#define GARROW_TYPE_INT16_SCALAR (garrow_int16_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowInt16Scalar,
                         garrow_int16_scalar,
                         GARROW,
                         INT16_SCALAR,
                         GArrowScalar)
struct _GArrowInt16ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowInt16Scalar *
garrow_int16_scalar_new(gint16 value);
GARROW_AVAILABLE_IN_5_0
gint16
garrow_int16_scalar_get_value(GArrowInt16Scalar *scalar);


#define GARROW_TYPE_INT32_SCALAR (garrow_int32_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowInt32Scalar,
                         garrow_int32_scalar,
                         GARROW,
                         INT32_SCALAR,
                         GArrowScalar)
struct _GArrowInt32ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowInt32Scalar *
garrow_int32_scalar_new(gint32 value);
GARROW_AVAILABLE_IN_5_0
gint32
garrow_int32_scalar_get_value(GArrowInt32Scalar *scalar);


#define GARROW_TYPE_INT64_SCALAR (garrow_int64_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowInt64Scalar,
                         garrow_int64_scalar,
                         GARROW,
                         INT64_SCALAR,
                         GArrowScalar)
struct _GArrowInt64ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowInt64Scalar *
garrow_int64_scalar_new(gint64 value);
GARROW_AVAILABLE_IN_5_0
gint64
garrow_int64_scalar_get_value(GArrowInt64Scalar *scalar);


#define GARROW_TYPE_UINT8_SCALAR (garrow_uint8_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowUInt8Scalar,
                         garrow_uint8_scalar,
                         GARROW,
                         UINT8_SCALAR,
                         GArrowScalar)
struct _GArrowUInt8ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowUInt8Scalar *
garrow_uint8_scalar_new(guint8 value);
GARROW_AVAILABLE_IN_5_0
guint8
garrow_uint8_scalar_get_value(GArrowUInt8Scalar *scalar);


#define GARROW_TYPE_UINT16_SCALAR (garrow_uint16_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowUInt16Scalar,
                         garrow_uint16_scalar,
                         GARROW,
                         UINT16_SCALAR,
                         GArrowScalar)
struct _GArrowUInt16ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowUInt16Scalar *
garrow_uint16_scalar_new(guint16 value);
GARROW_AVAILABLE_IN_5_0
guint16
garrow_uint16_scalar_get_value(GArrowUInt16Scalar *scalar);


#define GARROW_TYPE_UINT32_SCALAR (garrow_uint32_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowUInt32Scalar,
                         garrow_uint32_scalar,
                         GARROW,
                         UINT32_SCALAR,
                         GArrowScalar)
struct _GArrowUInt32ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowUInt32Scalar *
garrow_uint32_scalar_new(guint32 value);
GARROW_AVAILABLE_IN_5_0
guint32
garrow_uint32_scalar_get_value(GArrowUInt32Scalar *scalar);


#define GARROW_TYPE_UINT64_SCALAR (garrow_uint64_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowUInt64Scalar,
                         garrow_uint64_scalar,
                         GARROW,
                         UINT64_SCALAR,
                         GArrowScalar)
struct _GArrowUInt64ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowUInt64Scalar *
garrow_uint64_scalar_new(guint64 value);
GARROW_AVAILABLE_IN_5_0
guint64
garrow_uint64_scalar_get_value(GArrowUInt64Scalar *scalar);


#define GARROW_TYPE_FLOAT_SCALAR (garrow_float_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowFloatScalar,
                         garrow_float_scalar,
                         GARROW,
                         FLOAT_SCALAR,
                         GArrowScalar)
struct _GArrowFloatScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowFloatScalar *
garrow_float_scalar_new(gfloat value);
GARROW_AVAILABLE_IN_5_0
gfloat
garrow_float_scalar_get_value(GArrowFloatScalar *scalar);


#define GARROW_TYPE_DOUBLE_SCALAR (garrow_double_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDoubleScalar,
                         garrow_double_scalar,
                         GARROW,
                         DOUBLE_SCALAR,
                         GArrowScalar)
struct _GArrowDoubleScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDoubleScalar *
garrow_double_scalar_new(gdouble value);
GARROW_AVAILABLE_IN_5_0
gdouble
garrow_double_scalar_get_value(GArrowDoubleScalar *scalar);


#define GARROW_TYPE_BASE_BINARY_SCALAR (garrow_base_binary_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowBaseBinaryScalar,
                         garrow_base_binary_scalar,
                         GARROW,
                         BASE_BINARY_SCALAR,
                         GArrowScalar)
struct _GArrowBaseBinaryScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowBuffer *
garrow_base_binary_scalar_get_value(GArrowBaseBinaryScalar *scalar);


#define GARROW_TYPE_BINARY_SCALAR (garrow_binary_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowBinaryScalar,
                         garrow_binary_scalar,
                         GARROW,
                         BINARY_SCALAR,
                         GArrowBaseBinaryScalar)
struct _GArrowBinaryScalarClass
{
  GArrowBaseBinaryScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowBinaryScalar *
garrow_binary_scalar_new(GArrowBuffer *value);


#define GARROW_TYPE_STRING_SCALAR (garrow_string_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowStringScalar,
                         garrow_string_scalar,
                         GARROW,
                         STRING_SCALAR,
                         GArrowBaseBinaryScalar)
struct _GArrowStringScalarClass
{
  GArrowBaseBinaryScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowStringScalar *
garrow_string_scalar_new(GArrowBuffer *value);


#define GARROW_TYPE_LARGE_BINARY_SCALAR (garrow_large_binary_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowLargeBinaryScalar,
                         garrow_large_binary_scalar,
                         GARROW,
                         LARGE_BINARY_SCALAR,
                         GArrowBaseBinaryScalar)
struct _GArrowLargeBinaryScalarClass
{
  GArrowBaseBinaryScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowLargeBinaryScalar *
garrow_large_binary_scalar_new(GArrowBuffer *value);


#define GARROW_TYPE_LARGE_STRING_SCALAR (garrow_large_string_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowLargeStringScalar,
                         garrow_large_string_scalar,
                         GARROW,
                         LARGE_STRING_SCALAR,
                         GArrowBaseBinaryScalar)
struct _GArrowLargeStringScalarClass
{
  GArrowBaseBinaryScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowLargeStringScalar *
garrow_large_string_scalar_new(GArrowBuffer *value);


#define GARROW_TYPE_FIXED_SIZE_BINARY_SCALAR    \
  (garrow_fixed_size_binary_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowFixedSizeBinaryScalar,
                         garrow_fixed_size_binary_scalar,
                         GARROW,
                         FIXED_SIZE_BINARY_SCALAR,
                         GArrowBaseBinaryScalar)
struct _GArrowFixedSizeBinaryScalarClass
{
  GArrowBaseBinaryScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowFixedSizeBinaryScalar *
garrow_fixed_size_binary_scalar_new(GArrowFixedSizeBinaryDataType *data_type,
                                    GArrowBuffer *value);


#define GARROW_TYPE_DATE32_SCALAR (garrow_date32_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDate32Scalar,
                         garrow_date32_scalar,
                         GARROW,
                         DATE32_SCALAR,
                         GArrowScalar)
struct _GArrowDate32ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDate32Scalar *
garrow_date32_scalar_new(gint32 value);
GARROW_AVAILABLE_IN_5_0
gint32
garrow_date32_scalar_get_value(GArrowDate32Scalar *scalar);


#define GARROW_TYPE_DATE64_SCALAR (garrow_date64_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDate64Scalar,
                         garrow_date64_scalar,
                         GARROW,
                         DATE64_SCALAR,
                         GArrowScalar)
struct _GArrowDate64ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDate64Scalar *
garrow_date64_scalar_new(gint64 value);
GARROW_AVAILABLE_IN_5_0
gint64
garrow_date64_scalar_get_value(GArrowDate64Scalar *scalar);


#define GARROW_TYPE_TIME32_SCALAR (garrow_time32_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowTime32Scalar,
                         garrow_time32_scalar,
                         GARROW,
                         TIME32_SCALAR,
                         GArrowScalar)
struct _GArrowTime32ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowTime32Scalar *
garrow_time32_scalar_new(GArrowTime32DataType *data_type,
                         gint32 value);
GARROW_AVAILABLE_IN_5_0
gint32
garrow_time32_scalar_get_value(GArrowTime32Scalar *scalar);


#define GARROW_TYPE_TIME64_SCALAR (garrow_time64_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowTime64Scalar,
                         garrow_time64_scalar,
                         GARROW,
                         TIME64_SCALAR,
                         GArrowScalar)
struct _GArrowTime64ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowTime64Scalar *
garrow_time64_scalar_new(GArrowTime64DataType *data_type,
                         gint64 value);
GARROW_AVAILABLE_IN_5_0
gint64
garrow_time64_scalar_get_value(GArrowTime64Scalar *scalar);


#define GARROW_TYPE_TIMESTAMP_SCALAR (garrow_timestamp_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowTimestampScalar,
                         garrow_timestamp_scalar,
                         GARROW,
                         TIMESTAMP_SCALAR,
                         GArrowScalar)
struct _GArrowTimestampScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowTimestampScalar *
garrow_timestamp_scalar_new(GArrowTimestampDataType *data_type,
                            gint64 value);
GARROW_AVAILABLE_IN_5_0
gint64
garrow_timestamp_scalar_get_value(GArrowTimestampScalar *scalar);


#define GARROW_TYPE_DECIMAL128_SCALAR (garrow_decimal128_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDecimal128Scalar,
                         garrow_decimal128_scalar,
                         GARROW,
                         DECIMAL128_SCALAR,
                         GArrowScalar)
struct _GArrowDecimal128ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDecimal128Scalar *
garrow_decimal128_scalar_new(GArrowDecimal128DataType *data_type,
                             GArrowDecimal128 *value);
GARROW_AVAILABLE_IN_5_0
GArrowDecimal128 *
garrow_decimal128_scalar_get_value(GArrowDecimal128Scalar *scalar);


#define GARROW_TYPE_DECIMAL256_SCALAR (garrow_decimal256_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDecimal256Scalar,
                         garrow_decimal256_scalar,
                         GARROW,
                         DECIMAL256_SCALAR,
                         GArrowScalar)
struct _GArrowDecimal256ScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDecimal256Scalar *
garrow_decimal256_scalar_new(GArrowDecimal256DataType *data_type,
                             GArrowDecimal256 *value);
GARROW_AVAILABLE_IN_5_0
GArrowDecimal256 *
garrow_decimal256_scalar_get_value(GArrowDecimal256Scalar *scalar);


#define GARROW_TYPE_BASE_LIST_SCALAR (garrow_base_list_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowBaseListScalar,
                         garrow_base_list_scalar,
                         GARROW,
                         BASE_LIST_SCALAR,
                         GArrowScalar)
struct _GArrowBaseListScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowArray *
garrow_base_list_scalar_get_value(GArrowBaseListScalar *scalar);

#define GARROW_TYPE_LIST_SCALAR (garrow_list_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowListScalar,
                         garrow_list_scalar,
                         GARROW,
                         LIST_SCALAR,
                         GArrowBaseListScalar)
struct _GArrowListScalarClass
{
  GArrowBaseListScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowListScalar *
garrow_list_scalar_new(GArrowListArray *value);


#define GARROW_TYPE_LARGE_LIST_SCALAR (garrow_large_list_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowLargeListScalar,
                         garrow_large_list_scalar,
                         GARROW,
                         LARGE_LIST_SCALAR,
                         GArrowBaseListScalar)
struct _GArrowLargeListScalarClass
{
  GArrowBaseListScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowLargeListScalar *
garrow_large_list_scalar_new(GArrowLargeListArray *value);


#define GARROW_TYPE_MAP_SCALAR (garrow_map_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowMapScalar,
                         garrow_map_scalar,
                         GARROW,
                         MAP_SCALAR,
                         GArrowBaseListScalar)
struct _GArrowMapScalarClass
{
  GArrowBaseListScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowMapScalar *
garrow_map_scalar_new(GArrowStructArray *value);


#define GARROW_TYPE_STRUCT_SCALAR (garrow_struct_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowStructScalar,
                         garrow_struct_scalar,
                         GARROW,
                         STRUCT_SCALAR,
                         GArrowScalar)
struct _GArrowStructScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowStructScalar *
garrow_struct_scalar_new(GArrowStructDataType *data_type,
                         GList *value);
GARROW_AVAILABLE_IN_5_0
GList *
garrow_struct_scalar_get_value(GArrowStructScalar *scalar);


#define GARROW_TYPE_UNION_SCALAR (garrow_union_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowUnionScalar,
                         garrow_union_scalar,
                         GARROW,
                         UNION_SCALAR,
                         GArrowScalar)
struct _GArrowUnionScalarClass
{
  GArrowScalarClass parent_class;
};

GARROW_AVAILABLE_IN_6_0
gint8
garrow_union_scalar_get_type_code(GArrowUnionScalar *scalar);
GARROW_AVAILABLE_IN_5_0
GArrowScalar *
garrow_union_scalar_get_value(GArrowUnionScalar *scalar);


#define GARROW_TYPE_SPARSE_UNION_SCALAR (garrow_sparse_union_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowSparseUnionScalar,
                         garrow_sparse_union_scalar,
                         GARROW,
                         SPARSE_UNION_SCALAR,
                         GArrowUnionScalar)
struct _GArrowSparseUnionScalarClass
{
  GArrowUnionScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowSparseUnionScalar *
garrow_sparse_union_scalar_new(GArrowSparseUnionDataType *data_type,
                               gint8 type_code,
                               GArrowScalar *value);


#define GARROW_TYPE_DENSE_UNION_SCALAR (garrow_dense_union_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDenseUnionScalar,
                         garrow_dense_union_scalar,
                         GARROW,
                         DENSE_UNION_SCALAR,
                         GArrowUnionScalar)
struct _GArrowDenseUnionScalarClass
{
  GArrowUnionScalarClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowDenseUnionScalar *
garrow_dense_union_scalar_new(GArrowDenseUnionDataType *data_type,
                              gint8 type_code,
                              GArrowScalar *value);


#define GARROW_TYPE_EXTENSION_SCALAR (garrow_extension_scalar_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowExtensionScalar,
                         garrow_extension_scalar,
                         GARROW,
                         EXTENSION_SCALAR,
                         GArrowScalar)
struct _GArrowExtensionScalarClass
{
  GArrowScalarClass parent_class;
};

G_END_DECLS