@@ -273,6 +273,9 @@ G_BEGIN_DECLS
273273 * #GArrowExtractRegexSpanOptions is a class to customize the `extract_regex_span`
274274 * function.
275275 *
276+ * #GArrowJoinOptions is a class to customize the `binary_join_element_wise`
277+ * function.
278+ *
276279 * There are many functions to compute data on an array.
277280 */
278281
@@ -7278,6 +7281,125 @@ garrow_extract_regex_span_options_new(void)
72787281 return GARROW_EXTRACT_REGEX_SPAN_OPTIONS (options);
72797282}
72807283
7284+ enum {
7285+ PROP_JOIN_OPTIONS_NULL_HANDLING = 1 ,
7286+ PROP_JOIN_OPTIONS_NULL_REPLACEMENT,
7287+ };
7288+
7289+ G_DEFINE_TYPE (GArrowJoinOptions, garrow_join_options, GARROW_TYPE_FUNCTION_OPTIONS)
7290+
7291+ static void
7292+ garrow_join_options_set_property(GObject *object,
7293+ guint prop_id,
7294+ const GValue *value,
7295+ GParamSpec *pspec)
7296+ {
7297+ auto options = garrow_join_options_get_raw (GARROW_JOIN_OPTIONS (object));
7298+
7299+ switch (prop_id) {
7300+ case PROP_JOIN_OPTIONS_NULL_HANDLING:
7301+ options->null_handling =
7302+ static_cast <arrow::compute::JoinOptions::NullHandlingBehavior>(
7303+ g_value_get_enum (value));
7304+ break ;
7305+ case PROP_JOIN_OPTIONS_NULL_REPLACEMENT:
7306+ options->null_replacement = g_value_get_string (value);
7307+ break ;
7308+ default :
7309+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7310+ break ;
7311+ }
7312+ }
7313+
7314+ static void
7315+ garrow_join_options_get_property (GObject *object,
7316+ guint prop_id,
7317+ GValue *value,
7318+ GParamSpec *pspec)
7319+ {
7320+ auto options = garrow_join_options_get_raw (GARROW_JOIN_OPTIONS (object));
7321+
7322+ switch (prop_id) {
7323+ case PROP_JOIN_OPTIONS_NULL_HANDLING:
7324+ g_value_set_enum (value,
7325+ static_cast <GArrowJoinNullHandlingBehavior>(options->null_handling ));
7326+ break ;
7327+ case PROP_JOIN_OPTIONS_NULL_REPLACEMENT:
7328+ g_value_set_string (value, options->null_replacement .c_str ());
7329+ break ;
7330+ default :
7331+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7332+ break ;
7333+ }
7334+ }
7335+
7336+ static void
7337+ garrow_join_options_init (GArrowJoinOptions *object)
7338+ {
7339+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
7340+ priv->options =
7341+ static_cast <arrow::compute::FunctionOptions *>(new arrow::compute::JoinOptions ());
7342+ }
7343+
7344+ static void
7345+ garrow_join_options_class_init (GArrowJoinOptionsClass *klass)
7346+ {
7347+ auto gobject_class = G_OBJECT_CLASS (klass);
7348+
7349+ gobject_class->set_property = garrow_join_options_set_property;
7350+ gobject_class->get_property = garrow_join_options_get_property;
7351+
7352+ arrow::compute::JoinOptions options;
7353+
7354+ GParamSpec *spec;
7355+ /* *
7356+ * GArrowJoinOptions:null-handling:
7357+ *
7358+ * How to handle null values. (A null separator always results in a null output.)
7359+ *
7360+ * Since: 23.0.0
7361+ */
7362+ spec =
7363+ g_param_spec_enum (" null-handling" ,
7364+ " Null handling" ,
7365+ " How to handle null values" ,
7366+ GARROW_TYPE_JOIN_NULL_HANDLING_BEHAVIOR,
7367+ static_cast <GArrowJoinNullHandlingBehavior>(options.null_handling ),
7368+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7369+ g_object_class_install_property (gobject_class, PROP_JOIN_OPTIONS_NULL_HANDLING, spec);
7370+
7371+ /* *
7372+ * GArrowJoinOptions:null-replacement:
7373+ *
7374+ * Replacement string for null values when null-handling is REPLACE.
7375+ *
7376+ * Since: 23.0.0
7377+ */
7378+ spec = g_param_spec_string (
7379+ " null-replacement" ,
7380+ " Null replacement" ,
7381+ " Replacement string for null values when null-handling is REPLACE" ,
7382+ options.null_replacement .c_str (),
7383+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7384+ g_object_class_install_property (gobject_class,
7385+ PROP_JOIN_OPTIONS_NULL_REPLACEMENT,
7386+ spec);
7387+ }
7388+
7389+ /* *
7390+ * garrow_join_options_new:
7391+ *
7392+ * Returns: A newly created #GArrowJoinOptions.
7393+ *
7394+ * Since: 23.0.0
7395+ */
7396+ GArrowJoinOptions *
7397+ garrow_join_options_new (void )
7398+ {
7399+ auto options = g_object_new (GARROW_TYPE_JOIN_OPTIONS, nullptr );
7400+ return GARROW_JOIN_OPTIONS (options);
7401+ }
7402+
72817403G_END_DECLS
72827404
72837405arrow::Result<arrow::FieldRef>
@@ -7447,6 +7569,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
74477569 auto options =
74487570 garrow_extract_regex_span_options_new_raw (arrow_extract_regex_span_options);
74497571 return GARROW_FUNCTION_OPTIONS (options);
7572+ } else if (arrow_type_name == " JoinOptions" ) {
7573+ const auto arrow_join_options =
7574+ static_cast <const arrow::compute::JoinOptions *>(arrow_options);
7575+ auto options = garrow_join_options_new_raw (arrow_join_options);
7576+ return GARROW_FUNCTION_OPTIONS (options);
74507577 } else {
74517578 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
74527579 return GARROW_FUNCTION_OPTIONS (options);
@@ -8104,3 +8231,22 @@ garrow_extract_regex_span_options_get_raw(GArrowExtractRegexSpanOptions *options
81048231 return static_cast <arrow::compute::ExtractRegexSpanOptions *>(
81058232 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
81068233}
8234+
8235+ GArrowJoinOptions *
8236+ garrow_join_options_new_raw (const arrow::compute::JoinOptions *arrow_options)
8237+ {
8238+ return GARROW_JOIN_OPTIONS (g_object_new (
8239+ GARROW_TYPE_JOIN_OPTIONS,
8240+ " null-handling" ,
8241+ static_cast <GArrowJoinNullHandlingBehavior>(arrow_options->null_handling ),
8242+ " null-replacement" ,
8243+ arrow_options->null_replacement .c_str (),
8244+ nullptr ));
8245+ }
8246+
8247+ arrow::compute::JoinOptions *
8248+ garrow_join_options_get_raw (GArrowJoinOptions *options)
8249+ {
8250+ return static_cast <arrow::compute::JoinOptions *>(
8251+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
8252+ }
0 commit comments