Simplify BasePlanTest#assertMinimallyOptimizedPlan
@@ -109,16 +109,12 @@ public class BasePlanTest
protected void assertMinimallyOptimizedPlan(@Language("SQL") String sql, PlanMatchPattern pattern)
{
- LocalQueryRunner queryRunner = getQueryRunner();
List<PlanOptimizer> optimizers = ImmutableList.of(
new UnaliasSymbolReferences(),
new PruneUnreferencedOutputs(),
new IterativeOptimizer(new StatsRecorder(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
- queryRunner.inTransaction(transactionSession -> {
- Plan actualPlan = queryRunner.createPlan(transactionSession, sql, optimizers, LogicalPlanner.Stage.OPTIMIZED);
- PlanAssert.assertPlan(transactionSession, queryRunner.getMetadata(), queryRunner.getCostCalculator(), actualPlan, pattern);
- return null;
- });
+
+ assertPlanWithOptimizers(sql, pattern, optimizers);
}
protected Plan plan(String sql)
