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