ray.data.aggregate.AggregateFnV2.combine#
- abstract AggregateFnV2.combine(current_accumulator: AccumulatorType, new: AccumulatorType) AccumulatorType[source]#
- Combines a new partial aggregation result with the current accumulator. - This method defines how two intermediate aggregation states are merged. For example, if - aggregate_blockproduces partial sums- s1and- s2from two different blocks,- combine(s1, s2)should return- s1 + s2.- Parameters:
- current_accumulator – The current accumulated state (e.g., the result of previous - combinecalls or an initial value from- zero_factory).
- new – A new partially aggregated value, typically the output of - aggregate_blockfrom a new block of data, or another accumulator from a parallel task.
 
- Returns:
- The updated accumulator after combining it with the new value.