@@ -287,6 +287,8 @@ G_BEGIN_DECLS
287287 *
288288 * #GArrowModeOptions is a class to customize the `mode` function.
289289 *
290+ * #GArrowNullOptions is a class to customize the `is_null` function.
291+ *
290292 * There are many functions to compute data on an array.
291293 */
292294
@@ -8016,6 +8018,95 @@ garrow_mode_options_new(void)
80168018 return GARROW_MODE_OPTIONS (g_object_new (GARROW_TYPE_MODE_OPTIONS, NULL ));
80178019}
80188020
8021+ enum {
8022+ PROP_NULL_OPTIONS_NAN_IS_NULL = 1 ,
8023+ };
8024+
8025+ G_DEFINE_TYPE (GArrowNullOptions, garrow_null_options, GARROW_TYPE_FUNCTION_OPTIONS)
8026+
8027+ static void
8028+ garrow_null_options_set_property(GObject *object,
8029+ guint prop_id,
8030+ const GValue *value,
8031+ GParamSpec *pspec)
8032+ {
8033+ auto options = garrow_null_options_get_raw (GARROW_NULL_OPTIONS (object));
8034+
8035+ switch (prop_id) {
8036+ case PROP_NULL_OPTIONS_NAN_IS_NULL:
8037+ options->nan_is_null = g_value_get_boolean (value);
8038+ break ;
8039+ default :
8040+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
8041+ break ;
8042+ }
8043+ }
8044+
8045+ static void
8046+ garrow_null_options_get_property (GObject *object,
8047+ guint prop_id,
8048+ GValue *value,
8049+ GParamSpec *pspec)
8050+ {
8051+ auto options = garrow_null_options_get_raw (GARROW_NULL_OPTIONS (object));
8052+
8053+ switch (prop_id) {
8054+ case PROP_NULL_OPTIONS_NAN_IS_NULL:
8055+ g_value_set_boolean (value, options->nan_is_null );
8056+ break ;
8057+ default :
8058+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
8059+ break ;
8060+ }
8061+ }
8062+
8063+ static void
8064+ garrow_null_options_init (GArrowNullOptions *object)
8065+ {
8066+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
8067+ priv->options =
8068+ static_cast <arrow::compute::FunctionOptions *>(new arrow::compute::NullOptions ());
8069+ }
8070+
8071+ static void
8072+ garrow_null_options_class_init (GArrowNullOptionsClass *klass)
8073+ {
8074+ auto gobject_class = G_OBJECT_CLASS (klass);
8075+
8076+ gobject_class->set_property = garrow_null_options_set_property;
8077+ gobject_class->get_property = garrow_null_options_get_property;
8078+
8079+ arrow::compute::NullOptions options;
8080+
8081+ GParamSpec *spec;
8082+ /* *
8083+ * GArrowNullOptions:nan-is-null:
8084+ *
8085+ * Whether floating-point NaN values are considered null.
8086+ *
8087+ * Since: 23.0.0
8088+ */
8089+ spec = g_param_spec_boolean (" nan-is-null" ,
8090+ " NaN is null" ,
8091+ " Whether floating-point NaN values are considered null" ,
8092+ options.nan_is_null ,
8093+ static_cast <GParamFlags>(G_PARAM_READWRITE));
8094+ g_object_class_install_property (gobject_class, PROP_NULL_OPTIONS_NAN_IS_NULL, spec);
8095+ }
8096+
8097+ /* *
8098+ * garrow_null_options_new:
8099+ *
8100+ * Returns: A newly created #GArrowNullOptions.
8101+ *
8102+ * Since: 23.0.0
8103+ */
8104+ GArrowNullOptions *
8105+ garrow_null_options_new (void )
8106+ {
8107+ return GARROW_NULL_OPTIONS (g_object_new (GARROW_TYPE_NULL_OPTIONS, NULL ));
8108+ }
8109+
80198110G_END_DECLS
80208111
80218112arrow::Result<arrow::FieldRef>
@@ -8205,6 +8296,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
82058296 static_cast <const arrow::compute::ModeOptions *>(arrow_options);
82068297 auto options = garrow_mode_options_new_raw (arrow_mode_options);
82078298 return GARROW_FUNCTION_OPTIONS (options);
8299+ } else if (arrow_type_name == " NullOptions" ) {
8300+ const auto arrow_null_options =
8301+ static_cast <const arrow::compute::NullOptions *>(arrow_options);
8302+ auto options = garrow_null_options_new_raw (arrow_null_options);
8303+ return GARROW_FUNCTION_OPTIONS (options);
82088304 } else {
82098305 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
82108306 return GARROW_FUNCTION_OPTIONS (options);
@@ -8979,3 +9075,19 @@ garrow_mode_options_get_raw(GArrowModeOptions *options)
89799075 return static_cast <arrow::compute::ModeOptions *>(
89809076 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
89819077}
9078+
9079+ GArrowNullOptions *
9080+ garrow_null_options_new_raw (const arrow::compute::NullOptions *arrow_options)
9081+ {
9082+ return GARROW_NULL_OPTIONS (g_object_new (GARROW_TYPE_NULL_OPTIONS,
9083+ " nan-is-null" ,
9084+ arrow_options->nan_is_null ,
9085+ NULL ));
9086+ }
9087+
9088+ arrow::compute::NullOptions *
9089+ garrow_null_options_get_raw (GArrowNullOptions *options)
9090+ {
9091+ return static_cast <arrow::compute::NullOptions *>(
9092+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
9093+ }
0 commit comments