Search in sources :

Example 1 with ValidateLimitWithPresortedInput

use of io.trino.sql.planner.sanity.ValidateLimitWithPresortedInput in project trino by trinodb.

the class TestPartialTopNWithPresortedInput method assertPlanWithValidation.

private void assertPlanWithValidation(@Language("SQL") String sql, PlanMatchPattern pattern) {
    LocalQueryRunner queryRunner = getQueryRunner();
    queryRunner.inTransaction(queryRunner.getDefaultSession(), transactionSession -> {
        Plan actualPlan = queryRunner.createPlan(transactionSession, sql, OPTIMIZED_AND_VALIDATED, false, WarningCollector.NOOP);
        PlanAssert.assertPlan(transactionSession, queryRunner.getMetadata(), queryRunner.getFunctionManager(), queryRunner.getStatsCalculator(), actualPlan, pattern);
        PlannerContext plannerContext = queryRunner.getPlannerContext();
        new ValidateLimitWithPresortedInput().validate(actualPlan.getRoot(), transactionSession, plannerContext, createTestingTypeAnalyzer(plannerContext), actualPlan.getTypes(), WarningCollector.NOOP);
        return null;
    });
}
Also used : PlannerContext(io.trino.sql.PlannerContext) ValidateLimitWithPresortedInput(io.trino.sql.planner.sanity.ValidateLimitWithPresortedInput) Plan(io.trino.sql.planner.Plan) LocalQueryRunner(io.trino.testing.LocalQueryRunner)

Aggregations

PlannerContext (io.trino.sql.PlannerContext)1 Plan (io.trino.sql.planner.Plan)1 ValidateLimitWithPresortedInput (io.trino.sql.planner.sanity.ValidateLimitWithPresortedInput)1 LocalQueryRunner (io.trino.testing.LocalQueryRunner)1