presto-main/src/main/java/io/prestosql/sql/planner/optimizations/DistinctOutputQueryUtil.java/DistinctOutputQueryUtil/isDistinct
class DistinctOutputQueryUtil:    public static boolean isDistinct(PlanNode node, Function<PlanNode, PlanNode> lookupFunction)
    {
        return node.accept(new IsDistinctPlanVisitor(lookupFunction), null);
    }