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

Code before:
    });
  }
  for (gsize i = 0; i < n_keys; ++i) {
    if (!garrow_field_refs_add(arrow_keys,
                               keys[i],
                               error,
                               "[aggregate-node-options][new][key]")) {
      return NULL;
    }
  }
  auto arrow_options = new arrow::acero::AggregateNodeOptions(std::move(arrow_aggregates),
                                                              std::move(arrow_keys));
  auto options =
    g_object_new(GARROW_TYPE_AGGREGATE_NODE_OPTIONS, "options", arrow_options, nullptr);
  auto priv = GARROW_AGGREGATE_NODE_OPTIONS_GET_PRIVATE(options);
  priv->aggregations =
    g_list_copy_deep(aggregations, reinterpret_cast<GCopyFunc>(g_object_ref), nullptr);
  return GARROW_AGGREGATE_NODE_OPTIONS(options);
}

/**
 * garrow_aggregate_node_options_get_aggregations:
 * @options: A #GArrowAggregateNodeOptions.
 *
 * Returns: (transfer none) (element-type GArrowAggregation): Aggregations
 *   of this options.
 *
 * Since: 24.0.0
 */
GList *
garrow_aggregate_node_options_get_aggregations(GArrowAggregateNodeOptions *options)
{
  auto priv = GARROW_AGGREGATE_NODE_OPTIONS_GET_PRIVATE(options);
  return priv->aggregations;
}

typedef struct GArrowSinkNodeOptionsPrivate_
{
  arrow::AsyncGenerator<std::optional<arrow::compute::ExecBatch>> generator;
  GArrowRecordBatchReader *reader;
} GArrowSinkNodeOptionsPrivate;

G_DEFINE_TYPE_WITH_PRIVATE(GArrowSinkNodeOptions,
                           garrow_sink_node_options,
                           GARROW_TYPE_EXECUTE_NODE_OPTIONS)

#define GARROW_SINK_NODE_OPTIONS_GET_PRIVATE(object)                                     \
  static_cast<GArrowSinkNodeOptionsPrivate *>(                                           \
    garrow_sink_node_options_get_instance_private(GARROW_SINK_NODE_OPTIONS(object)))

static void

Review comment (suggestion):
The docstring sentence "Aggregations of this options." is ungrammatical; it should be "Aggregations of these options." or similar. Please adjust the wording to improve the clarity of the API documentation.
```suggestion
 *   of these options.
```

Code after:
    });
  }
  for (gsize i = 0; i < n_keys; ++i) {
    if (!garrow_field_refs_add(arrow_keys,
                               keys[i],
                               error,
                               "[aggregate-node-options][new][key]")) {
      return NULL;
    }
  }
  auto arrow_options = new arrow::acero::AggregateNodeOptions(std::move(arrow_aggregates),
                                                              std::move(arrow_keys));
  auto options =
    g_object_new(GARROW_TYPE_AGGREGATE_NODE_OPTIONS, "options", arrow_options, nullptr);
  auto priv = GARROW_AGGREGATE_NODE_OPTIONS_GET_PRIVATE(options);
  priv->aggregations =
    g_list_copy_deep(aggregations, reinterpret_cast<GCopyFunc>(g_object_ref), nullptr);
  return GARROW_AGGREGATE_NODE_OPTIONS(options);
}

/**
 * garrow_aggregate_node_options_get_aggregations:
 * @options: A #GArrowAggregateNodeOptions.
 *
 * Returns: (transfer none) (element-type GArrowAggregation): Aggregations
 *   of the @options.
 *
 * Since: 24.0.0
 */
GList *
garrow_aggregate_node_options_get_aggregations(GArrowAggregateNodeOptions *options)
{
  auto priv = GARROW_AGGREGATE_NODE_OPTIONS_GET_PRIVATE(options);
  return priv->aggregations;
}

typedef struct GArrowSinkNodeOptionsPrivate_
{
  arrow::AsyncGenerator<std::optional<arrow::compute::ExecBatch>> generator;
  GArrowRecordBatchReader *reader;
} GArrowSinkNodeOptionsPrivate;

G_DEFINE_TYPE_WITH_PRIVATE(GArrowSinkNodeOptions,
                           garrow_sink_node_options,
                           GARROW_TYPE_EXECUTE_NODE_OPTIONS)

#define GARROW_SINK_NODE_OPTIONS_GET_PRIVATE(object)                                     \
  static_cast<GArrowSinkNodeOptionsPrivate *>(                                           \
    garrow_sink_node_options_get_instance_private(GARROW_SINK_NODE_OPTIONS(object)))

static void