presto-main/src/main/java/io/prestosql/operator/aggregation/AverageAggregations.java/AverageAggregations/input
class AverageAggregations:    @InputFunction
    public static void input(@AggregationState LongAndDoubleState state, @SqlType(StandardTypes.BIGINT) long value)
    {
        state.setLong(state.getLong() + 1);
        state.setDouble(state.getDouble() + value);
    }