presto-main/src/main/java/io/prestosql/sql/planner/plan/AggregationNode.java/AggregationNode/producesDistinctRows
class AggregationNode:    public boolean producesDistinctRows()
    {
        return aggregations.isEmpty() &&
                !groupingSets.getGroupingKeys().isEmpty() &&
                outputs.size() == groupingSets.getGroupingKeys().size() &&
                outputs.containsAll(new HashSet<>(groupingSets.getGroupingKeys()));
    }