Search in sources :

Example 1 with NestedTableJoinStrategy

use of org.teiid.query.processor.relational.NestedTableJoinStrategy in project teiid by teiid.

the class TestTextTable method testTextTableJoin.

@Test
public void testTextTableJoin() throws Exception {
    String sql = "select z.* from (select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x) as z, " + "(select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x) as z1 where z.x = z1.x";
    List<?>[] expected = new List<?>[] { Arrays.asList("c"), Arrays.asList("1"), Arrays.asList("true") };
    FakeDataManager dataManager = new FakeDataManager();
    sampleData1(dataManager);
    RelationalPlan plan = (RelationalPlan) helpGetPlan(helpParse(sql), RealMetadataFactory.example1Cached());
    JoinNode join = (JoinNode) plan.getRootNode().getChildren()[0];
    assertTrue(!(join.getJoinStrategy() instanceof NestedTableJoinStrategy));
    helpProcess(plan, createCommandContext(), dataManager, expected);
}
Also used : NestedTableJoinStrategy(org.teiid.query.processor.relational.NestedTableJoinStrategy) JoinNode(org.teiid.query.processor.relational.JoinNode) ArrayList(java.util.ArrayList) List(java.util.List) RelationalPlan(org.teiid.query.processor.relational.RelationalPlan) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Test (org.junit.Test)1 JoinNode (org.teiid.query.processor.relational.JoinNode)1 NestedTableJoinStrategy (org.teiid.query.processor.relational.NestedTableJoinStrategy)1 RelationalPlan (org.teiid.query.processor.relational.RelationalPlan)1