presto-main/src/main/java/io/prestosql/operator/aggregation/minmaxby/AbstractMinMaxByNAggregationFunction.java/AbstractMinMaxByNAggregationFunction/specialize
class AbstractMinMaxByNAggregationFunction:    @Override
    public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, Metadata metadata)
    {
        Type keyType = boundVariables.getTypeVariable("K");
        Type valueType = boundVariables.getTypeVariable("V");
        return generateAggregation(valueType, keyType);
    }