use of com.facebook.presto.sql.planner.StatsRecorder in project presto by prestodb.
the class TestIterativeOptimizer method optimizerTimeoutsOnNonConvergingPlan.
@Test(timeOut = 1000)
public void optimizerTimeoutsOnNonConvergingPlan() {
PlanOptimizer optimizer = new IterativeOptimizer(new StatsRecorder(), ImmutableSet.of(new NonConvergingRule()));
try {
queryRunner.inTransaction(transactionSession -> {
queryRunner.createPlan(transactionSession, "SELECT * FROM nation", ImmutableList.of(optimizer));
fail("The optimizer should not converge");
return null;
});
} catch (PrestoException ex) {
assertEquals(ex.getErrorCode(), OPTIMIZER_TIMEOUT.toErrorCode());
}
}
Aggregations