Search in sources :

Example 1 with OptimizerRule

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;
}
Also used : AnalysisRecord(org.teiid.query.analysis.AnalysisRecord) CommandContext(org.teiid.query.util.CommandContext) OptimizerRule(org.teiid.query.optimizer.relational.OptimizerRule)

Aggregations

AnalysisRecord (org.teiid.query.analysis.AnalysisRecord)1 OptimizerRule (org.teiid.query.optimizer.relational.OptimizerRule)1 CommandContext (org.teiid.query.util.CommandContext)1