public PlanNode plan(Analysis analysis)
    {
        return planStatement(analysis, analysis.getStatement());
    }
@Test
    public void testRedundantDistinctLimitNodeRemoval()
    {
        Session exploitConstraints = Session.builder(this.getQueryRunner().getDefaultSession())
                .setSystemProperty(EXPLOIT_CONSTRAINTS, Boolean.toString(true))
                .build();

        String query = "SELECT distinct(c) FROM (SELECT count(*) as c FROM orders) LIMIT 10";
        assertFalse(
                searchFrom(plan(query, OPTIMIZED, exploitConstraints).getRoot())
                        .where(isInstanceOfAny(DistinctLimitNode.class))
                        .matches(),
                format("Unexpected DistinctLimit node for query: '%s'", query));

        assertPlan(
                "SELECT distinct(c) FROM (SELECT count(*) as c FROM orders GROUP BY orderkey) LIMIT 10",
                output(
                        node(DistinctLimitNode.class,
                                anyTree(
                                        tableScan("orders")))));
    }