Aggregator for AVG(). Extends the SumAggregator and
implements a count. Result is then sum()/count().
To handle overflow we catch the exception for
value out of range, then we swap the holder for
the current sum to one that can handle a larger
range. Eventually a sum may end up in a SQLDecimal
which can handle an infinite range. Once this
type promotion has happened, it will not revert back
to the original type, even if the sum would fit in
a lesser type.
Return the result of the aggregation. If the count
is zero, then we haven't averaged anything yet, so
we return null. Otherwise, return the running
average as a double.
null or the average as Double