Search in sources :

Example 1 with PruneIdentityProjections

use of com.facebook.presto.sql.planner.optimizations.PruneIdentityProjections in project presto by prestodb.

the class BasePlanTest method assertMinimallyOptimizedPlan.

protected void assertMinimallyOptimizedPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    LocalQueryRunner queryRunner = getQueryRunner();
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(), new PruneUnreferencedOutputs(), new PruneIdentityProjections());
    queryRunner.inTransaction(transactionSession -> {
        Plan actualPlan = queryRunner.createPlan(transactionSession, sql, optimizers, LogicalPlanner.Stage.OPTIMIZED);
        PlanAssert.assertPlan(transactionSession, queryRunner.getMetadata(), actualPlan, pattern);
        return null;
    });
}
Also used : PlanOptimizer(com.facebook.presto.sql.planner.optimizations.PlanOptimizer) PruneUnreferencedOutputs(com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs) PruneIdentityProjections(com.facebook.presto.sql.planner.optimizations.PruneIdentityProjections) Plan(com.facebook.presto.sql.planner.Plan) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) UnaliasSymbolReferences(com.facebook.presto.sql.planner.optimizations.UnaliasSymbolReferences)

Aggregations

Plan (com.facebook.presto.sql.planner.Plan)1 PlanOptimizer (com.facebook.presto.sql.planner.optimizations.PlanOptimizer)1 PruneIdentityProjections (com.facebook.presto.sql.planner.optimizations.PruneIdentityProjections)1 PruneUnreferencedOutputs (com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs)1 UnaliasSymbolReferences (com.facebook.presto.sql.planner.optimizations.UnaliasSymbolReferences)1 LocalQueryRunner (com.facebook.presto.testing.LocalQueryRunner)1