pyarrow.acero.AggregateNodeOptions#
- classpyarrow.acero.AggregateNodeOptions(aggregates,keys=None)#
Bases:
_AggregateNodeOptionsMake a node which aggregates input batches, optionally grouped by keys.
This is the option class for the “aggregate” node factory.
Acero supports two types of aggregates: “scalar” aggregates,and “hash” aggregates. Scalar aggregates reduce an array or scalarinput to a single scalar output (e.g. computing the mean of a column).Hash aggregates act like GROUP BY in SQL and first partition databased on one or more key columns, then reduce the data in each partition.The aggregate node supports both types of computation, and can computeany number of aggregations at once.
- Parameters:
- aggregates
listoftuples Aggregations which will be applied to the targeted fields.Specified as a list of tuples, where each tuple is one aggregationspecification and consists of: aggregation target column(s) followedby function name, aggregation function options object and theoutput field name.The target column(s) specification can be a single field reference,an empty list or a list of fields unary, nullary and n-ary aggregationfunctions respectively. Each field reference can be a stringcolumn name or expression.
- keys
listoffieldreferences, optional Keys by which aggregations will be grouped. Each key can referencea field using a string name or expression.
- aggregates
- __init__(self,aggregates,keys=None)#
Methods
__init__(self, aggregates[, keys])

