@@ -251,6 +251,9 @@ G_BEGIN_DECLS
251251 * #GArrowStructFieldOptions is a class to customize the `struct_field`
252252 * function.
253253 *
254+ * #GArrowElementWiseAggregateOptions is a class to customize element-wise
255+ * aggregate functions such as `min_element_wise` and `max_element_wise`.
256+ *
254257 * There are many functions to compute data on an array.
255258 */
256259
@@ -6338,6 +6341,105 @@ garrow_struct_field_options_new(void)
63386341 return GARROW_STRUCT_FIELD_OPTIONS (options);
63396342}
63406343
6344+ enum {
6345+ PROP_ELEMENT_WISE_AGGREGATE_OPTIONS_SKIP_NULLS = 1 ,
6346+ };
6347+
6348+ G_DEFINE_TYPE (GArrowElementWiseAggregateOptions,
6349+ garrow_element_wise_aggregate_options,
6350+ GARROW_TYPE_FUNCTION_OPTIONS)
6351+
6352+ static void
6353+ garrow_element_wise_aggregate_options_set_property(GObject *object,
6354+ guint prop_id,
6355+ const GValue *value,
6356+ GParamSpec *pspec)
6357+ {
6358+ auto options = garrow_element_wise_aggregate_options_get_raw (
6359+ GARROW_ELEMENT_WISE_AGGREGATE_OPTIONS (object));
6360+
6361+ switch (prop_id) {
6362+ case PROP_ELEMENT_WISE_AGGREGATE_OPTIONS_SKIP_NULLS:
6363+ options->skip_nulls = g_value_get_boolean (value);
6364+ break ;
6365+ default :
6366+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
6367+ break ;
6368+ }
6369+ }
6370+
6371+ static void
6372+ garrow_element_wise_aggregate_options_get_property (GObject *object,
6373+ guint prop_id,
6374+ GValue *value,
6375+ GParamSpec *pspec)
6376+ {
6377+ auto options = garrow_element_wise_aggregate_options_get_raw (
6378+ GARROW_ELEMENT_WISE_AGGREGATE_OPTIONS (object));
6379+
6380+ switch (prop_id) {
6381+ case PROP_ELEMENT_WISE_AGGREGATE_OPTIONS_SKIP_NULLS:
6382+ g_value_set_boolean (value, options->skip_nulls );
6383+ break ;
6384+ default :
6385+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
6386+ break ;
6387+ }
6388+ }
6389+
6390+ static void
6391+ garrow_element_wise_aggregate_options_init (GArrowElementWiseAggregateOptions *object)
6392+ {
6393+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
6394+ priv->options = static_cast <arrow::compute::FunctionOptions *>(
6395+ new arrow::compute::ElementWiseAggregateOptions ());
6396+ }
6397+
6398+ static void
6399+ garrow_element_wise_aggregate_options_class_init (
6400+ GArrowElementWiseAggregateOptionsClass *klass)
6401+ {
6402+ auto gobject_class = G_OBJECT_CLASS (klass);
6403+
6404+ gobject_class->set_property = garrow_element_wise_aggregate_options_set_property;
6405+ gobject_class->get_property = garrow_element_wise_aggregate_options_get_property;
6406+
6407+ arrow::compute::ElementWiseAggregateOptions options;
6408+
6409+ GParamSpec *spec;
6410+ /* *
6411+ * GArrowElementWiseAggregateOptions:skip-nulls:
6412+ *
6413+ * Whether to skip (ignore) nulls in the input.
6414+ * If false, any null in the input forces the output to null.
6415+ *
6416+ * Since: 23.0.0
6417+ */
6418+ spec = g_param_spec_boolean (" skip-nulls" ,
6419+ " Skip nulls" ,
6420+ " Whether to skip (ignore) nulls in the input. If false, "
6421+ " any null in the input forces the output to null" ,
6422+ options.skip_nulls ,
6423+ static_cast <GParamFlags>(G_PARAM_READWRITE));
6424+ g_object_class_install_property (gobject_class,
6425+ PROP_ELEMENT_WISE_AGGREGATE_OPTIONS_SKIP_NULLS,
6426+ spec);
6427+ }
6428+
6429+ /* *
6430+ * garrow_element_wise_aggregate_options_new:
6431+ *
6432+ * Returns: A newly created #GArrowElementWiseAggregateOptions.
6433+ *
6434+ * Since: 23.0.0
6435+ */
6436+ GArrowElementWiseAggregateOptions *
6437+ garrow_element_wise_aggregate_options_new (void )
6438+ {
6439+ auto options = g_object_new (GARROW_TYPE_ELEMENT_WISE_AGGREGATE_OPTIONS, NULL );
6440+ return GARROW_ELEMENT_WISE_AGGREGATE_OPTIONS (options);
6441+ }
6442+
63416443G_END_DECLS
63426444
63436445arrow::Result<arrow::FieldRef>
@@ -6469,6 +6571,12 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
64696571 static_cast <const arrow::compute::StructFieldOptions *>(arrow_options);
64706572 auto options = garrow_struct_field_options_new_raw (arrow_struct_field_options);
64716573 return GARROW_FUNCTION_OPTIONS (options);
6574+ } else if (arrow_type_name == " ElementWiseAggregateOptions" ) {
6575+ const auto arrow_element_wise_aggregate_options =
6576+ static_cast <const arrow::compute::ElementWiseAggregateOptions *>(arrow_options);
6577+ auto options =
6578+ garrow_element_wise_aggregate_options_new_raw (arrow_element_wise_aggregate_options);
6579+ return GARROW_FUNCTION_OPTIONS (options);
64726580 } else {
64736581 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
64746582 return GARROW_FUNCTION_OPTIONS (options);
@@ -6987,3 +7095,21 @@ garrow_struct_field_options_get_raw(GArrowStructFieldOptions *options)
69877095 return static_cast <arrow::compute::StructFieldOptions *>(
69887096 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
69897097}
7098+
7099+ GArrowElementWiseAggregateOptions *
7100+ garrow_element_wise_aggregate_options_new_raw (
7101+ const arrow::compute::ElementWiseAggregateOptions *arrow_options)
7102+ {
7103+ return GARROW_ELEMENT_WISE_AGGREGATE_OPTIONS (
7104+ g_object_new (GARROW_TYPE_ELEMENT_WISE_AGGREGATE_OPTIONS,
7105+ " skip-nulls" ,
7106+ arrow_options->skip_nulls ,
7107+ NULL ));
7108+ }
7109+
7110+ arrow::compute::ElementWiseAggregateOptions *
7111+ garrow_element_wise_aggregate_options_get_raw (GArrowElementWiseAggregateOptions *options)
7112+ {
7113+ return static_cast <arrow::compute::ElementWiseAggregateOptions *>(
7114+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
7115+ }
0 commit comments