@@ -269,6 +269,9 @@ G_BEGIN_DECLS
269269 * #GArrowExtractRegexOptions is a class to customize the `extract_regex`
270270 * function.
271271 *
272+ * #GArrowJoinOptions is a class to customize the `binary_join_element_wise`
273+ * function.
274+ *
272275 * There are many functions to compute data on an array.
273276 */
274277
@@ -7091,6 +7094,125 @@ garrow_extract_regex_options_new(void)
70917094 return GARROW_EXTRACT_REGEX_OPTIONS (options);
70927095}
70937096
7097+ enum {
7098+ PROP_JOIN_OPTIONS_NULL_HANDLING = 1 ,
7099+ PROP_JOIN_OPTIONS_NULL_REPLACEMENT,
7100+ };
7101+
7102+ G_DEFINE_TYPE (GArrowJoinOptions, garrow_join_options, GARROW_TYPE_FUNCTION_OPTIONS)
7103+
7104+ static void
7105+ garrow_join_options_set_property(GObject *object,
7106+ guint prop_id,
7107+ const GValue *value,
7108+ GParamSpec *pspec)
7109+ {
7110+ auto options = garrow_join_options_get_raw (GARROW_JOIN_OPTIONS (object));
7111+
7112+ switch (prop_id) {
7113+ case PROP_JOIN_OPTIONS_NULL_HANDLING:
7114+ options->null_handling =
7115+ static_cast <arrow::compute::JoinOptions::NullHandlingBehavior>(
7116+ g_value_get_enum (value));
7117+ break ;
7118+ case PROP_JOIN_OPTIONS_NULL_REPLACEMENT:
7119+ options->null_replacement = g_value_get_string (value);
7120+ break ;
7121+ default :
7122+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7123+ break ;
7124+ }
7125+ }
7126+
7127+ static void
7128+ garrow_join_options_get_property (GObject *object,
7129+ guint prop_id,
7130+ GValue *value,
7131+ GParamSpec *pspec)
7132+ {
7133+ auto options = garrow_join_options_get_raw (GARROW_JOIN_OPTIONS (object));
7134+
7135+ switch (prop_id) {
7136+ case PROP_JOIN_OPTIONS_NULL_HANDLING:
7137+ g_value_set_enum (value,
7138+ static_cast <GArrowJoinNullHandlingBehavior>(options->null_handling ));
7139+ break ;
7140+ case PROP_JOIN_OPTIONS_NULL_REPLACEMENT:
7141+ g_value_set_string (value, options->null_replacement .c_str ());
7142+ break ;
7143+ default :
7144+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7145+ break ;
7146+ }
7147+ }
7148+
7149+ static void
7150+ garrow_join_options_init (GArrowJoinOptions *object)
7151+ {
7152+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
7153+ priv->options =
7154+ static_cast <arrow::compute::FunctionOptions *>(new arrow::compute::JoinOptions ());
7155+ }
7156+
7157+ static void
7158+ garrow_join_options_class_init (GArrowJoinOptionsClass *klass)
7159+ {
7160+ auto gobject_class = G_OBJECT_CLASS (klass);
7161+
7162+ gobject_class->set_property = garrow_join_options_set_property;
7163+ gobject_class->get_property = garrow_join_options_get_property;
7164+
7165+ arrow::compute::JoinOptions options;
7166+
7167+ GParamSpec *spec;
7168+ /* *
7169+ * GArrowJoinOptions:null-handling:
7170+ *
7171+ * How to handle null values. (A null separator always results in a null output.)
7172+ *
7173+ * Since: 23.0.0
7174+ */
7175+ spec =
7176+ g_param_spec_enum (" null-handling" ,
7177+ " Null handling" ,
7178+ " How to handle null values" ,
7179+ GARROW_TYPE_JOIN_NULL_HANDLING_BEHAVIOR,
7180+ static_cast <GArrowJoinNullHandlingBehavior>(options.null_handling ),
7181+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7182+ g_object_class_install_property (gobject_class, PROP_JOIN_OPTIONS_NULL_HANDLING, spec);
7183+
7184+ /* *
7185+ * GArrowJoinOptions:null-replacement:
7186+ *
7187+ * Replacement string for null values when null-handling is REPLACE.
7188+ *
7189+ * Since: 23.0.0
7190+ */
7191+ spec = g_param_spec_string (
7192+ " null-replacement" ,
7193+ " Null replacement" ,
7194+ " Replacement string for null values when null-handling is REPLACE" ,
7195+ options.null_replacement .c_str (),
7196+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7197+ g_object_class_install_property (gobject_class,
7198+ PROP_JOIN_OPTIONS_NULL_REPLACEMENT,
7199+ spec);
7200+ }
7201+
7202+ /* *
7203+ * garrow_join_options_new:
7204+ *
7205+ * Returns: A newly created #GArrowJoinOptions.
7206+ *
7207+ * Since: 23.0.0
7208+ */
7209+ GArrowJoinOptions *
7210+ garrow_join_options_new (void )
7211+ {
7212+ auto options = g_object_new (GARROW_TYPE_JOIN_OPTIONS, NULL );
7213+ return GARROW_JOIN_OPTIONS (options);
7214+ }
7215+
70947216G_END_DECLS
70957217
70967218arrow::Result<arrow::FieldRef>
@@ -7254,6 +7376,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
72547376 static_cast <const arrow::compute::ExtractRegexOptions *>(arrow_options);
72557377 auto options = garrow_extract_regex_options_new_raw (arrow_extract_regex_options);
72567378 return GARROW_FUNCTION_OPTIONS (options);
7379+ } else if (arrow_type_name == " JoinOptions" ) {
7380+ const auto arrow_join_options =
7381+ static_cast <const arrow::compute::JoinOptions *>(arrow_options);
7382+ auto options = garrow_join_options_new_raw (arrow_join_options);
7383+ return GARROW_FUNCTION_OPTIONS (options);
72577384 } else {
72587385 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
72597386 return GARROW_FUNCTION_OPTIONS (options);
@@ -7893,3 +8020,22 @@ garrow_extract_regex_options_get_raw(GArrowExtractRegexOptions *options)
78938020 return static_cast <arrow::compute::ExtractRegexOptions *>(
78948021 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
78958022}
8023+
8024+ GArrowJoinOptions *
8025+ garrow_join_options_new_raw (const arrow::compute::JoinOptions *arrow_options)
8026+ {
8027+ return GARROW_JOIN_OPTIONS (g_object_new (
8028+ GARROW_TYPE_JOIN_OPTIONS,
8029+ " null-handling" ,
8030+ static_cast <GArrowJoinNullHandlingBehavior>(arrow_options->null_handling ),
8031+ " null-replacement" ,
8032+ arrow_options->null_replacement .c_str (),
8033+ NULL ));
8034+ }
8035+
8036+ arrow::compute::JoinOptions *
8037+ garrow_join_options_get_raw (GArrowJoinOptions *options)
8038+ {
8039+ return static_cast <arrow::compute::JoinOptions *>(
8040+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
8041+ }
0 commit comments