presto-main/src/main/java/io/prestosql/operator/aggregation/AbstractMinMaxAggregationFunction.java/AbstractMinMaxAggregationFunction/specialize
class AbstractMinMaxAggregationFunction:    @Override
    public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, Metadata metadata)
    {
        Type type = boundVariables.getTypeVariable("E");
        MethodHandle compareMethodHandle = metadata.getScalarFunctionImplementation(metadata.resolveOperator(operatorType, ImmutableList.of(type, type))).getMethodHandle();
        return generateAggregation(type, compareMethodHandle);
    }