use of io.trino.spi.StandardErrorCode.OPTIMIZER_TIMEOUT in project trino by trinodb.
the class TestIterativeOptimizer method optimizerTimeoutsOnNonConvergingPlan.
@Test(timeOut = 10_000)
public void optimizerTimeoutsOnNonConvergingPlan() {
PlanOptimizer optimizer = new IterativeOptimizer(queryRunner.getPlannerContext(), new RuleStatsRecorder(), queryRunner.getStatsCalculator(), queryRunner.getCostCalculator(), ImmutableSet.of(new AddIdentityOverTableScan(), new RemoveRedundantIdentityProjections()));
assertTrinoExceptionThrownBy(() -> queryRunner.inTransaction(transactionSession -> queryRunner.createPlan(transactionSession, "SELECT nationkey FROM nation", ImmutableList.of(optimizer), WarningCollector.NOOP))).hasErrorCode(OPTIMIZER_TIMEOUT).hasMessageMatching("The optimizer exhausted the time limit of 1 ms: (no rules invoked|(?s)Top rules:.*(RemoveRedundantIdentityProjections|AddIdentityOverTableScan).*)");
}
Aggregations