Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a3c2d36
Add GArrowFixedSizeListArray
stenlarsson Dec 4, 2025
7a1d27b
Add GArrowAssumeTimezoneOptions
stenlarsson Dec 3, 2025
9a66ed8
Add GArrowCumulativeOptions
stenlarsson Dec 3, 2025
f4c15da
Add GArrowDayOfWeekOptions
stenlarsson Dec 3, 2025
8bda36b
Add GArrowDictionaryEncodeOptions
stenlarsson Dec 3, 2025
829a9e4
Add GArrowElementWiseAggregateOptions
stenlarsson Dec 3, 2025
e5e62fe
Add GArrowExtractRegexOptions
stenlarsson Dec 3, 2025
2b5753f
Add GArrowExtractRegexSpanOptions
stenlarsson Dec 4, 2025
b138539
Add GArrowJoinOptions
stenlarsson Dec 4, 2025
948c255
Add GArrowListFlattenOptions
stenlarsson Dec 4, 2025
1585f66
Add GArrowListSliceOptions
stenlarsson Dec 4, 2025
f3d799d
Add GArrowMakeStructOptions
stenlarsson Dec 4, 2025
9af1cf0
Add GArrowMapLookupOptions
stenlarsson Dec 4, 2025
fe05d09
Add GArrowModeOptions
stenlarsson Dec 4, 2025
05de1cd
Add GArrowNullOptions
stenlarsson Dec 4, 2025
8a7e4a2
Add GArrowPadOptions
stenlarsson Dec 4, 2025
4f4ed40
Add GArrowPairwiseOptions
stenlarsson Dec 4, 2025
e93ec78
Add GArrowPartitionNthOptions
stenlarsson Dec 4, 2025
91ae715
Add GArrowPivotWiderOptions
stenlarsson Dec 4, 2025
c799ae6
Add GArrowRankQuantileOptions
stenlarsson Dec 4, 2025
2670d07
Add GArrowReplaceSliceOptions
stenlarsson Dec 4, 2025
280d622
Add GReplaceSubstringOptions
stenlarsson Dec 4, 2025
bf02ca3
Add GArrowRoundBinaryOptions
stenlarsson Dec 4, 2025
b9a9ae8
Add GArrowRoundTemporalOptions
stenlarsson Dec 4, 2025
4d0c06f
Add GArrowSelectKOptions
stenlarsson Dec 4, 2025
ffa7073
Add GArrowSkewOptions
stenlarsson Dec 4, 2025
0d66a0a
Add GArrowSliceOptions
stenlarsson Dec 4, 2025
2e46099
Add GArrowSplitOptions
stenlarsson Dec 4, 2025
247c9ff
Add GArrowTDigestOptions
stenlarsson Dec 4, 2025
95a0520
Add GArrowTrimOptions
stenlarsson Dec 4, 2025
a7dd553
Add GArrowWeekOptions
stenlarsson Dec 4, 2025
31ea947
Add GArrowWinsorizeOptions
stenlarsson Dec 4, 2025
83251e0
Add GArrowZeroFillOptions
stenlarsson Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions c_glib/arrow-glib/array-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5674,6 +5674,125 @@ garrow_large_list_array_builder_get_value_builder(GArrowLargeListArrayBuilder *b
return priv->value_builder;
}

typedef struct GArrowFixedSizeListArrayBuilderPrivate_
{
GArrowArrayBuilder *value_builder;
} GArrowFixedSizeListArrayBuilderPrivate;

G_DEFINE_TYPE_WITH_PRIVATE(GArrowFixedSizeListArrayBuilder,
garrow_fixed_size_list_array_builder,
GARROW_TYPE_ARRAY_BUILDER)

#define GARROW_FIXED_SIZE_LIST_ARRAY_BUILDER_GET_PRIVATE(obj) \
static_cast<GArrowFixedSizeListArrayBuilderPrivate *>( \
garrow_fixed_size_list_array_builder_get_instance_private( \
GARROW_FIXED_SIZE_LIST_ARRAY_BUILDER(obj)))

static void
garrow_fixed_size_list_array_builder_dispose(GObject *object)
{
auto priv = GARROW_FIXED_SIZE_LIST_ARRAY_BUILDER_GET_PRIVATE(object);

if (priv->value_builder) {
g_object_unref(priv->value_builder);
priv->value_builder = NULL;
}

G_OBJECT_CLASS(garrow_fixed_size_list_array_builder_parent_class)->dispose(object);
}

static void
garrow_fixed_size_list_array_builder_init(GArrowFixedSizeListArrayBuilder *builder)
{
}

static void
garrow_fixed_size_list_array_builder_class_init(
GArrowFixedSizeListArrayBuilderClass *klass)
{
auto gobject_class = G_OBJECT_CLASS(klass);

gobject_class->dispose = garrow_fixed_size_list_array_builder_dispose;
}

/**
* garrow_fixed_size_list_array_builder_new:
* @data_type: A #GArrowFixedSizeListDataType for value.
* @error: (nullable): Return location for a #GError or %NULL.
*
* Returns: A newly created #GArrowFixedSizeListArrayBuilder.
*
* Since: 23.0.0
*/
GArrowFixedSizeListArrayBuilder *
garrow_fixed_size_list_array_builder_new(GArrowFixedSizeListDataType *data_type,
GError **error)
{
if (!GARROW_IS_FIXED_SIZE_LIST_DATA_TYPE(data_type)) {
g_set_error(
error,
GARROW_ERROR,
GARROW_ERROR_INVALID,
"[fixed-size-list-array-builder][new] data type must be fixed-size list data type");
return NULL;
}

auto arrow_data_type = garrow_data_type_get_raw(GARROW_DATA_TYPE(data_type));
auto builder = garrow_array_builder_new(arrow_data_type,
error,
"[fixed-size-list-array-builder][new]");
return GARROW_FIXED_SIZE_LIST_ARRAY_BUILDER(builder);
}

/**
* garrow_fixed_size_list_array_builder_append_value:
* @builder: A #GArrowFixedSizeListArrayBuilder.
* @error: (nullable): Return location for a #GError or %NULL.
*
* Returns: %TRUE on success, %FALSE if there was an error.
*
* It appends a new list element. To append a new list element, you
* need to call this function then append list element values to
* `value_builder`. `value_builder` is the #GArrowArrayBuilder
* specified to constructor. You can get `value_builder` by
* garrow_fixed_size_list_array_builder_get_value_builder().
*
* Since: 23.0.0
*/
gboolean
garrow_fixed_size_list_array_builder_append_value(
GArrowFixedSizeListArrayBuilder *builder, GError **error)
{
auto arrow_builder = std::static_pointer_cast<arrow::FixedSizeListBuilder>(
garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)));
auto status = arrow_builder->Append();
return garrow_error_check(error,
status,
"[fixed-size-list-array-builder][append-value]");
}

/**
* garrow_fixed_size_list_array_builder_get_value_builder:
* @builder: A #GArrowFixedSizeListArrayBuilder.
*
* Returns: (transfer none): The #GArrowArrayBuilder for building list element values.
*
* Since: 23.0.0
*/
GArrowArrayBuilder *
garrow_fixed_size_list_array_builder_get_value_builder(
GArrowFixedSizeListArrayBuilder *builder)
{
auto priv = GARROW_FIXED_SIZE_LIST_ARRAY_BUILDER_GET_PRIVATE(builder);
if (!priv->value_builder) {
auto arrow_builder = std::static_pointer_cast<arrow::FixedSizeListBuilder>(
garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)));
auto arrow_value_builder = arrow_builder->value_builder();
priv->value_builder = garrow_array_builder_new_raw(arrow_value_builder);
}
return priv->value_builder;
}

G_DEFINE_TYPE(GArrowStructArrayBuilder,
garrow_struct_array_builder,
GARROW_TYPE_ARRAY_BUILDER)
Expand Down Expand Up @@ -6779,6 +6898,9 @@ garrow_array_builder_new_raw(std::shared_ptr<arrow::ArrayBuilder> *arrow_builder
case arrow::Type::type::LARGE_LIST:
type = GARROW_TYPE_LARGE_LIST_ARRAY_BUILDER;
break;
case arrow::Type::type::FIXED_SIZE_LIST:
type = GARROW_TYPE_FIXED_SIZE_LIST_ARRAY_BUILDER;
break;
case arrow::Type::type::STRUCT:
type = GARROW_TYPE_STRUCT_ARRAY_BUILDER;
break;
Expand Down
26 changes: 26 additions & 0 deletions c_glib/arrow-glib/array-builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,32 @@ GARROW_AVAILABLE_IN_0_16
GArrowArrayBuilder *
garrow_large_list_array_builder_get_value_builder(GArrowLargeListArrayBuilder *builder);

#define GARROW_TYPE_FIXED_SIZE_LIST_ARRAY_BUILDER \
(garrow_fixed_size_list_array_builder_get_type())
GARROW_AVAILABLE_IN_23_0
G_DECLARE_DERIVABLE_TYPE(GArrowFixedSizeListArrayBuilder,
garrow_fixed_size_list_array_builder,
GARROW,
FIXED_SIZE_LIST_ARRAY_BUILDER,
GArrowArrayBuilder)
struct _GArrowFixedSizeListArrayBuilderClass
{
GArrowArrayBuilderClass parent_class;
};

GARROW_AVAILABLE_IN_23_0
GArrowFixedSizeListArrayBuilder *
garrow_fixed_size_list_array_builder_new(GArrowFixedSizeListDataType *data_type,
GError **error);
GARROW_AVAILABLE_IN_23_0
gboolean
garrow_fixed_size_list_array_builder_append_value(
GArrowFixedSizeListArrayBuilder *builder, GError **error);
GARROW_AVAILABLE_IN_23_0
GArrowArrayBuilder *
garrow_fixed_size_list_array_builder_get_value_builder(
GArrowFixedSizeListArrayBuilder *builder);

#define GARROW_TYPE_STRUCT_ARRAY_BUILDER (garrow_struct_array_builder_get_type())
GARROW_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE(GArrowStructArrayBuilder,
Expand Down
3 changes: 3 additions & 0 deletions c_glib/arrow-glib/basic-array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4005,6 +4005,9 @@ garrow_array_new_raw_valist(std::shared_ptr<arrow::Array> *arrow_array,
case arrow::Type::type::LARGE_LIST:
type = GARROW_TYPE_LARGE_LIST_ARRAY;
break;
case arrow::Type::type::FIXED_SIZE_LIST:
type = GARROW_TYPE_FIXED_SIZE_LIST_ARRAY;
break;
case arrow::Type::type::STRUCT:
type = GARROW_TYPE_STRUCT_ARRAY;
break;
Expand Down
Loading
Loading