presto-main/src/main/java/io/prestosql/operator/Aggregator.java/Aggregator/getType
class Aggregator:    public Type getType()
    {
        if (step.isOutputPartial()) {
            return aggregation.getIntermediateType();
        }
        else {
            return aggregation.getFinalType();
        }
    }