presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/MergeLimitWithDistinct.java/MergeLimitWithDistinct/apply
class MergeLimitWithDistinct:    @Override
    public Result apply(LimitNode parent, Captures captures, Context context)
    {
        AggregationNode child = captures.get(CHILD);

        return Result.ofPlanNode(
                new DistinctLimitNode(
                        parent.getId(),
                        child.getSource(),
                        parent.getCount(),
                        false,
                        child.getGroupingKeys(),
                        child.getHashSymbol()));
    }