presto-main/src/main/java/io/prestosql/sql/planner/optimizations/DistinctOutputQueryUtil.java/DistinctOutputQueryUtil/visitLimit
class DistinctOutputQueryUtil:        @Override
        public Boolean visitLimit(LimitNode node, Void context)
        {
            return node.getCount() <= 1;
        }