Repository: apache/arrow
File: c_glib/arrow-glib/compute.cpp (C++)

Code before:
  return static_cast<arrow::compute::JoinOptions *>(
    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));
}

GArrowListFlattenOptions *
garrow_list_flatten_options_new_raw(
  const arrow::compute::ListFlattenOptions *arrow_options)
{
  return GARROW_LIST_FLATTEN_OPTIONS(g_object_new(GARROW_TYPE_LIST_FLATTEN_OPTIONS,
                                                  "recursive",
                                                  arrow_options->recursive,
                                                  NULL));
}

arrow::compute::ListFlattenOptions *
garrow_list_flatten_options_get_raw(GArrowListFlattenOptions *options)
{
  return static_cast<arrow::compute::ListFlattenOptions *>(
    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));
}

GArrowMakeStructOptions *
garrow_make_struct_options_new_raw(const arrow::compute::MakeStructOptions *arrow_options)
{
  auto options =
    GARROW_MAKE_STRUCT_OPTIONS(g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, NULL));
  auto arrow_new_options = static_cast<arrow::compute::MakeStructOptions *>(
    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));
  *arrow_new_options = *arrow_options;
  return options;
}

arrow::compute::MakeStructOptions *
garrow_make_struct_options_get_raw(GArrowMakeStructOptions *options)
{
  return static_cast<arrow::compute::MakeStructOptions *>(
    garrow_function_options_get_raw(GARROW_FUNCTION_OPTIONS(options)));
}


Review comment (bug):
```suggestion
    GARROW_MAKE_STRUCT_OPTIONS(g_object_new(GARROW_TYPE_MAKE_STRUCT_OPTIONS, nullptr));
```

Code after:
                            G_MININT64,
                            G_MAXINT64,
                            options.stop,
                            static_cast<GParamFlags>(G_PARAM_READWRITE));
  g_object_class_install_property(gobject_class, PROP_REPLACE_SLICE_OPTIONS_STOP, spec);

  /**
   * GArrowReplaceSliceOptions:replacement:
   *
   * String to replace the slice with.
   *
   * Since: 23.0.0
   */
  spec = g_param_spec_string("replacement",
                             "Replacement",
                             "String to replace the slice with",
                             options.replacement.c_str(),
                             static_cast<GParamFlags>(G_PARAM_READWRITE));
  g_object_class_install_property(gobject_class,
                                  PROP_REPLACE_SLICE_OPTIONS_REPLACEMENT,
                                  spec);
}

/**
 * garrow_replace_slice_options_new:
 *
 * Returns: A newly created #GArrowReplaceSliceOptions.
 *
 * Since: 23.0.0
 */
GArrowReplaceSliceOptions *
garrow_replace_slice_options_new(void)
{
  return GARROW_REPLACE_SLICE_OPTIONS(
    g_object_new(GARROW_TYPE_REPLACE_SLICE_OPTIONS, nullptr));
}

enum {
  PROP_PARTITION_NTH_OPTIONS_PIVOT = 1,
  PROP_PARTITION_NTH_OPTIONS_NULL_PLACEMENT,
};

G_DEFINE_TYPE(GArrowPartitionNthOptions,
              garrow_partition_nth_options,
              GARROW_TYPE_FUNCTION_OPTIONS)

static void
garrow_partition_nth_options_set_property(GObject *object,
                                          guint prop_id,
                                          const GValue *value,
                                          GParamSpec *pspec)