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

Code before:
   * Since: 23.0.0
   */
  spec = g_param_spec_int64("max_replacements",
                            "Max Replacements",
                            "Max number of substrings to replace (-1 means unbounded)",
                            G_MININT64,
                            G_MAXINT64,
                            options.max_replacements,
                            static_cast<GParamFlags>(G_PARAM_READWRITE));
  g_object_class_install_property(gobject_class,
                                  PROP_REPLACE_SUBSTRING_OPTIONS_MAX_REPLACEMENTS,
                                  spec);
}

/**
 * garrow_replace_substring_options_new:
 *
 * Returns: A newly created #GArrowReplaceSubstringOptions.
 *
 * Since: 23.0.0
 */
GArrowReplaceSubstringOptions *
garrow_replace_substring_options_new(void)
{
  return GARROW_REPLACE_SUBSTRING_OPTIONS(
    g_object_new(GARROW_TYPE_REPLACE_SUBSTRING_OPTIONS, NULL));
}

G_END_DECLS

arrow::Result<arrow::FieldRef>
garrow_field_reference_resolve_raw(const gchar *reference)
{
  if (reference && (reference[0] == '.' || reference[0] == '[')) {
    return arrow::FieldRef::FromDotPath(reference);
  } else {
    arrow::FieldRef arrow_reference(reference);
    return arrow_reference;
  }
}

arrow::compute::ExecContext *
garrow_execute_context_get_raw(GArrowExecuteContext *context)
{
  auto priv = GARROW_EXECUTE_CONTEXT_GET_PRIVATE(context);
  return &priv->context;
}

GArrowFunctionOptions *
garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_options)
{

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

Code after:
}

static void
garrow_extract_regex_span_options_init(GArrowExtractRegexSpanOptions *object)
{
  auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE(object);
  priv->options = static_cast<arrow::compute::FunctionOptions *>(
    new arrow::compute::ExtractRegexSpanOptions());
}

static void
garrow_extract_regex_span_options_class_init(GArrowExtractRegexSpanOptionsClass *klass)
{
  auto gobject_class = G_OBJECT_CLASS(klass);

  gobject_class->set_property = garrow_extract_regex_span_options_set_property;
  gobject_class->get_property = garrow_extract_regex_span_options_get_property;

  arrow::compute::ExtractRegexSpanOptions options;

  GParamSpec *spec;
  /**
   * GArrowExtractRegexSpanOptions:pattern:
   *
   * Regular expression with named capture fields.
   *
   * Since: 23.0.0
   */
  spec = g_param_spec_string("pattern",
                             "Pattern",
                             "Regular expression with named capture fields",
                             options.pattern.c_str(),
                             static_cast<GParamFlags>(G_PARAM_READWRITE));
  g_object_class_install_property(gobject_class,
                                  PROP_EXTRACT_REGEX_SPAN_OPTIONS_PATTERN,
                                  spec);
}

/**
 * garrow_extract_regex_span_options_new:
 *
 * Returns: A newly created #GArrowExtractRegexSpanOptions.
 *
 * Since: 23.0.0
 */
GArrowExtractRegexSpanOptions *
garrow_extract_regex_span_options_new(void)
{
  auto options = g_object_new(GARROW_TYPE_EXTRACT_REGEX_SPAN_OPTIONS, NULL);
  return GARROW_EXTRACT_REGEX_SPAN_OPTIONS(options);
}