use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testDefect10711.
@Test
public void testDefect10711() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT * from vm1.g1a as X", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), // $NON-NLS-1$
new String[] { "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1" });
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testCase4265ControlTest.
/**
* Test of RuleCopyCriteria. Criteria should be copied across a join only for an equality operator in
* the join criteria.
*/
@Test
public void testCase4265ControlTest() throws Exception {
// $NON-NLS-1$
String sql = "SELECT X.intkey, Y.intkey FROM BQT1.SmallA X, BQT1.SmallA Y WHERE X.IntKey = Y.IntKey and Y.IntKey = 1";
ProcessorPlan plan = helpPlan(sql, RealMetadataFactory.exampleBQTCached(), new String[] { "SELECT g_0.IntKey FROM BQT1.SmallA AS g_0 WHERE g_0.IntKey = 1" }, // $NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING);
checkNodeTypes(plan, new int[] { // Access
2, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
0, // Join
1, // MergeJoin
0, // Null
0, // PlanExecution
0, // Project
1, // Select
0, // Sort
0, // UnionAll
0 });
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testUnionAllPushdownVirtualGroup.
@Test
public void testUnionAllPushdownVirtualGroup() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
// $NON-NLS-1$
caps.setFunctionSupport("convert", true);
// $NON-NLS-1$
capFinder.addCapabilities("pm1", caps);
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT * FROM vm1.g4", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), null, capFinder, // $NON-NLS-1$
new String[] { "SELECT e1 FROM pm1.g1 UNION ALL SELECT convert(e2, string) FROM pm1.g2" }, SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testPushDistinctVirtual2.
@Test
public void testPushDistinctVirtual2() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select DISTINCT * from vm1.g12", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), // $NON-NLS-1$
new String[] { "SELECT DISTINCT pm3.g1.e1, pm3.g1.e2, pm3.g1.e3, pm3.g1.e4 FROM pm3.g1" });
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testQueryManyJoin.
@Test
public void testQueryManyJoin() throws Exception {
QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT pm1.g1.e1 FROM pm1.g1 JOIN ((pm1.g2 JOIN pm1.g3 ON pm1.g2.e1=pm1.g3.e1) JOIN pm1.g4 ON pm1.g3.e1=pm1.g4.e1) ON pm1.g1.e1=pm1.g4.e1", metadata, new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g3 AS g_2, pm1.g4 AS g_3 WHERE (g_1.e1 = g_2.e1) AND (g_2.e1 = g_3.e1) AND (g_0.e1 = g_3.e1)" }, // $NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
Aggregations