Skip to content

Commit

Permalink
cleaned up GroupBy description
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Dec 9, 2022
1 parent f5f7dcc commit 1b407e2
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cpp/src/arrow/compute/exec/groupby.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,24 @@ struct SimpleAggregate {
std::shared_ptr<FunctionOptions> options;
};

/// Helper function to perform a group-by given the arguments and keys as columns instead
/// of an exec batch / record batch.
/// Convenience function to perform a group-by given the arguments and keys as columns
///
/// This will combine the inputs into a single exec batch, feed that exec batch into a
/// plan with an aggregate node, and then extract the result of that plan into record
/// batches.
/// The result will be calculated using an exec plan with an aggregate node
///
/// The output may contain multiple exec batches if the input is large enough to be
/// The output may contain multiple chunks if the input is large enough to be
/// processed in pieces
///
/// The aggregates array must be the same size as the arguments array. Each aggregate
/// will be applied to the argument with the same index.
/// The aggregates vector must be the same size as the arguments vector. Each aggregate
/// will be applied to the argument with the same index. An array could be included in
/// the `arguments` vector multiple times to compute multiple aggregates.
///
/// The resulting batches will have one column for each key and one column for each
/// aggregate.
/// \return a table that will have one column for each aggregate, named after they
/// aggregate function, and one column for each key, named key0, key1, ...
///
/// The output columns will be named for the aggregate function names
/// If there are no arguments/aggregates then the returned table will have one row
/// for each unique combination of keys
///
/// If there are no keys then the aggregates will be applied to the full array
ARROW_EXPORT
Result<std::shared_ptr<Table>> GroupBy(
const std::vector<std::shared_ptr<Array>>& arguments,
Expand Down

0 comments on commit 1b407e2

Please sign in to comment.