use of org.teiid.query.optimizer.relational.OptimizerRule in project teiid by teiid.
the class TestRuleAccessPatternValidation method helpExecuteRules.
/**
* Simulate execution of the QueryOptimizer rules stack
*/
private static PlanNode helpExecuteRules(RuleStack rules, PlanNode plan, QueryMetadataInterface metadata, boolean debug) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
CommandContext context = new CommandContext();
while (!rules.isEmpty()) {
if (debug) {
// $NON-NLS-1$
System.out.println("\n============================================================================");
}
OptimizerRule rule = rules.pop();
if (debug) {
// $NON-NLS-1$
System.out.println("EXECUTING " + rule);
}
plan = rule.execute(plan, metadata, FINDER, rules, new AnalysisRecord(false, debug), context);
if (debug) {
// $NON-NLS-1$
System.out.println("\nAFTER: \n" + plan);
}
}
return plan;
}
Aggregations