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

Code before:
    arrow_expressions.push_back(*garrow_expression_get_raw(expression));
  }
  for (gsize i = 0; i < n_names; ++i) {
    arrow_names.emplace_back(names[i]);
  }
  if (!arrow_names.empty()) {
    for (size_t i = arrow_names.size(); i < arrow_expressions.size(); ++i) {
      arrow_names.push_back(arrow_expressions[i].ToString());
    }
  }
  auto arrow_options =
    new arrow::acero::ProjectNodeOptions(arrow_expressions, arrow_names);
  auto options =
    g_object_new(GARROW_TYPE_PROJECT_NODE_OPTIONS, "options", arrow_options, NULL);
  auto priv = GARROW_PROJECT_NODE_OPTIONS_GET_PRIVATE(options);
  priv->expressions =
    g_list_copy_deep(expressions, reinterpret_cast<GCopyFunc>(g_object_ref), nullptr);
  return GARROW_PROJECT_NODE_OPTIONS(options);
}

/**
 * garrow_project_node_options_get_expressions:
 * @options: A #GArrowProjectNodeOptions.
 *
 * Returns: (transfer none) (element-type GArrowExpression): Expressions
 *   of this options.
 *
 * Since: 24.0.0
 */
GList *
garrow_project_node_options_get_expressions(GArrowProjectNodeOptions *options)
{
  auto priv = GARROW_PROJECT_NODE_OPTIONS_GET_PRIVATE(options);
  return priv->expressions;
}

typedef struct GArrowAggregationPrivate_
{
  gchar *function;
  GArrowFunctionOptions *options;
  gchar *input;
  gchar *output;
} GArrowAggregationPrivate;

enum {
  PROP_AGGREGATION_FUNCTION = 1,
  PROP_AGGREGATION_OPTIONS,
  PROP_AGGREGATION_INPUT,
  PROP_AGGREGATION_OUTPUT,
};


Review comment (suggestion):
The docstring sentence "Expressions of this options." is ungrammatical; it should be "Expressions of these options." or similar. Updating the wording will make the API documentation clearer for users.
```suggestion
 *   of these options.
```

Code after:
    arrow_expressions.push_back(*garrow_expression_get_raw(expression));
  }
  for (gsize i = 0; i < n_names; ++i) {
    arrow_names.emplace_back(names[i]);
  }
  if (!arrow_names.empty()) {
    for (size_t i = arrow_names.size(); i < arrow_expressions.size(); ++i) {
      arrow_names.push_back(arrow_expressions[i].ToString());
    }
  }
  auto arrow_options =
    new arrow::acero::ProjectNodeOptions(arrow_expressions, arrow_names);
  auto options =
    g_object_new(GARROW_TYPE_PROJECT_NODE_OPTIONS, "options", arrow_options, NULL);
  auto priv = GARROW_PROJECT_NODE_OPTIONS_GET_PRIVATE(options);
  priv->expressions =
    g_list_copy_deep(expressions, reinterpret_cast<GCopyFunc>(g_object_ref), nullptr);
  return GARROW_PROJECT_NODE_OPTIONS(options);
}

/**
 * garrow_project_node_options_get_expressions:
 * @options: A #GArrowProjectNodeOptions.
 *
 * Returns: (transfer none) (element-type GArrowExpression): Expressions
 *   of the @options.
 *
 * Since: 24.0.0
 */
GList *
garrow_project_node_options_get_expressions(GArrowProjectNodeOptions *options)
{
  auto priv = GARROW_PROJECT_NODE_OPTIONS_GET_PRIVATE(options);
  return priv->expressions;
}

typedef struct GArrowAggregationPrivate_
{
  gchar *function;
  GArrowFunctionOptions *options;
  gchar *input;
  gchar *output;
} GArrowAggregationPrivate;

enum {
  PROP_AGGREGATION_FUNCTION = 1,
  PROP_AGGREGATION_OPTIONS,
  PROP_AGGREGATION_INPUT,
  PROP_AGGREGATION_OUTPUT,
};