@@ -269,6 +269,8 @@ G_BEGIN_DECLS
269269 * #GArrowExtractRegexOptions is a class to customize the `extract_regex`
270270 * function.
271271 *
272+ * #GArrowNullOptions is a class to customize the `is_null` function.
273+ *
272274 * There are many functions to compute data on an array.
273275 */
274276
@@ -7091,6 +7093,95 @@ garrow_extract_regex_options_new(void)
70917093 return GARROW_EXTRACT_REGEX_OPTIONS (options);
70927094}
70937095
7096+ enum {
7097+ PROP_NULL_OPTIONS_NAN_IS_NULL = 1 ,
7098+ };
7099+
7100+ G_DEFINE_TYPE (GArrowNullOptions, garrow_null_options, GARROW_TYPE_FUNCTION_OPTIONS)
7101+
7102+ static void
7103+ garrow_null_options_set_property(GObject *object,
7104+ guint prop_id,
7105+ const GValue *value,
7106+ GParamSpec *pspec)
7107+ {
7108+ auto options = garrow_null_options_get_raw (GARROW_NULL_OPTIONS (object));
7109+
7110+ switch (prop_id) {
7111+ case PROP_NULL_OPTIONS_NAN_IS_NULL:
7112+ options->nan_is_null = g_value_get_boolean (value);
7113+ break ;
7114+ default :
7115+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7116+ break ;
7117+ }
7118+ }
7119+
7120+ static void
7121+ garrow_null_options_get_property (GObject *object,
7122+ guint prop_id,
7123+ GValue *value,
7124+ GParamSpec *pspec)
7125+ {
7126+ auto options = garrow_null_options_get_raw (GARROW_NULL_OPTIONS (object));
7127+
7128+ switch (prop_id) {
7129+ case PROP_NULL_OPTIONS_NAN_IS_NULL:
7130+ g_value_set_boolean (value, options->nan_is_null );
7131+ break ;
7132+ default :
7133+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7134+ break ;
7135+ }
7136+ }
7137+
7138+ static void
7139+ garrow_null_options_init (GArrowNullOptions *object)
7140+ {
7141+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
7142+ priv->options =
7143+ static_cast <arrow::compute::FunctionOptions *>(new arrow::compute::NullOptions ());
7144+ }
7145+
7146+ static void
7147+ garrow_null_options_class_init (GArrowNullOptionsClass *klass)
7148+ {
7149+ auto gobject_class = G_OBJECT_CLASS (klass);
7150+
7151+ gobject_class->set_property = garrow_null_options_set_property;
7152+ gobject_class->get_property = garrow_null_options_get_property;
7153+
7154+ arrow::compute::NullOptions options;
7155+
7156+ GParamSpec *spec;
7157+ /* *
7158+ * GArrowNullOptions:nan-is-null:
7159+ *
7160+ * Whether floating-point NaN values are considered null.
7161+ *
7162+ * Since: 23.0.0
7163+ */
7164+ spec = g_param_spec_boolean (" nan-is-null" ,
7165+ " NaN is null" ,
7166+ " Whether floating-point NaN values are considered null" ,
7167+ options.nan_is_null ,
7168+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7169+ g_object_class_install_property (gobject_class, PROP_NULL_OPTIONS_NAN_IS_NULL, spec);
7170+ }
7171+
7172+ /* *
7173+ * garrow_null_options_new:
7174+ *
7175+ * Returns: A newly created #GArrowNullOptions.
7176+ *
7177+ * Since: 23.0.0
7178+ */
7179+ GArrowNullOptions *
7180+ garrow_null_options_new (void )
7181+ {
7182+ return GARROW_NULL_OPTIONS (g_object_new (GARROW_TYPE_NULL_OPTIONS, NULL ));
7183+ }
7184+
70947185G_END_DECLS
70957186
70967187arrow::Result<arrow::FieldRef>
@@ -7254,6 +7345,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
72547345 static_cast <const arrow::compute::ExtractRegexOptions *>(arrow_options);
72557346 auto options = garrow_extract_regex_options_new_raw (arrow_extract_regex_options);
72567347 return GARROW_FUNCTION_OPTIONS (options);
7348+ } else if (arrow_type_name == " NullOptions" ) {
7349+ const auto arrow_null_options =
7350+ static_cast <const arrow::compute::NullOptions *>(arrow_options);
7351+ auto options = garrow_null_options_new_raw (arrow_null_options);
7352+ return GARROW_FUNCTION_OPTIONS (options);
72577353 } else {
72587354 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
72597355 return GARROW_FUNCTION_OPTIONS (options);
@@ -7893,3 +7989,19 @@ garrow_extract_regex_options_get_raw(GArrowExtractRegexOptions *options)
78937989 return static_cast <arrow::compute::ExtractRegexOptions *>(
78947990 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
78957991}
7992+
7993+ GArrowNullOptions *
7994+ garrow_null_options_new_raw (const arrow::compute::NullOptions *arrow_options)
7995+ {
7996+ return GARROW_NULL_OPTIONS (g_object_new (GARROW_TYPE_NULL_OPTIONS,
7997+ " nan-is-null" ,
7998+ arrow_options->nan_is_null ,
7999+ NULL ));
8000+ }
8001+
8002+ arrow::compute::NullOptions *
8003+ garrow_null_options_get_raw (GArrowNullOptions *options)
8004+ {
8005+ return static_cast <arrow::compute::NullOptions *>(
8006+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
8007+ }
0 commit comments