Class AverageBy is used to average values associated with duplicate keys in a tuple stream.
Typically finding the average value in a tuple stream relies on a {@link cascading.pipe.GroupBy} and a {@link cascading.operation.aggregator.Average}{@link cascading.operation.Aggregator} operation.
If the given {@code averageFields} has an associated type, this type will be used to coerce the resulting average value,otherwise the result will be a {@link Double}.
If {@code include} is {@link Include#NO_NULLS}, {@code null} values will not be included in the average (converted to zero).By default (and for backwards compatibility) {@code null} values are included, {@link Include#ALL}.
This SubAssembly uses the {@link cascading.pipe.assembly.AverageBy.AveragePartials} {@link cascading.pipe.assembly.AggregateBy.Functor}and private {@link AverageFinal} Aggregator to count and sum as many field values before the GroupBy operator to reduce IO over the network.
This strategy is similar to using {@code combiners}, except no sorting or serialization is invoked and results in a much simpler mechanism.
The {@code threshold} value tells the underlying AveragePartials functions how many unique key sums and counts to accumulatein the LRU cache, before emitting the least recently used entry.
By default, either the value of {@link #AGGREGATE_BY_THRESHOLD} System property or {@link AggregateBy#DEFAULT_THRESHOLD}will be used.
@see cascading.pipe.assembly.AggregateBy