Search in sources :

Example 1 with CreateCursorResultSetInstruction

use of org.teiid.query.processor.proc.CreateCursorResultSetInstruction in project teiid by teiid.

the class TestProcedureRelational method helpTestProcRelational.

private void helpTestProcRelational(String userQuery, String inputCriteria, String atomicQuery) {
    ProcessorPlan plan = TestOptimizer.helpPlan(userQuery, RealMetadataFactory.example1Cached(), new String[] {});
    RelationalPlan rplan = (RelationalPlan) plan;
    RelationalNode root = rplan.getRootNode();
    while (root.getChildren() != null) {
        root = root.getChildren()[0];
        if (root instanceof DependentProcedureExecutionNode) {
            break;
        }
    }
    DependentProcedureExecutionNode dep = (DependentProcedureExecutionNode) root;
    assertEquals(inputCriteria, dep.getInputCriteria().toString());
    ProcedurePlan pp = (ProcedurePlan) dep.getProcessorPlan();
    CreateCursorResultSetInstruction ccrsi = (CreateCursorResultSetInstruction) pp.getOriginalProgram().getInstructionAt(0);
    plan = ccrsi.getCommand();
    TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
    TestOptimizer.checkAtomicQueries(new String[] { atomicQuery }, plan);
}
Also used : RelationalNode(org.teiid.query.processor.relational.RelationalNode) DependentProcedureExecutionNode(org.teiid.query.processor.relational.DependentProcedureExecutionNode) ProcedurePlan(org.teiid.query.processor.proc.ProcedurePlan) RelationalPlan(org.teiid.query.processor.relational.RelationalPlan) CreateCursorResultSetInstruction(org.teiid.query.processor.proc.CreateCursorResultSetInstruction)

Aggregations

CreateCursorResultSetInstruction (org.teiid.query.processor.proc.CreateCursorResultSetInstruction)1 ProcedurePlan (org.teiid.query.processor.proc.ProcedurePlan)1 DependentProcedureExecutionNode (org.teiid.query.processor.relational.DependentProcedureExecutionNode)1 RelationalNode (org.teiid.query.processor.relational.RelationalNode)1 RelationalPlan (org.teiid.query.processor.relational.RelationalPlan)1