use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testPushGroupBy1.
@Test
public void testPushGroupBy1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
// $NON-NLS-1$
capFinder.addCapabilities("pm1", caps);
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT e1, e2 as x FROM pm1.g1 GROUP BY e1, e2", RealMetadataFactory.example1Cached(), null, capFinder, // $NON-NLS-1$
new String[] { "SELECT e1, e2 FROM pm1.g1 GROUP BY e1, e2" }, SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testCase2507A.
@Test
public void testCase2507A() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
// $NON-NLS-1$
caps.setFunctionSupport("concat", true);
// $NON-NLS-1$
capFinder.addCapabilities("BQT1", caps);
QueryMetadataInterface metadata = RealMetadataFactory.exampleBQTCached();
// $NON-NLS-1$
String sql = "SELECT CONCAT(bqt1.smalla.stringKey, bqt1.smalla.stringNum) as EXPR, bqt1.smalla.stringKey as EXPR_1 FROM bqt1.smalla ORDER BY EXPR, EXPR_1";
ProcessorPlan plan = helpPlan(sql, metadata, null, capFinder, // $NON-NLS-1$
new String[] { "SELECT CONCAT(bqt1.smalla.stringKey, bqt1.smalla.stringNum) AS EXPR, bqt1.smalla.stringKey AS EXPR_1 FROM bqt1.smalla ORDER BY EXPR, EXPR_1" }, SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testPushOrderBy.
/**
* Tests a user's order by is pushed to the source
*/
@Test
public void testPushOrderBy() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT pm3.g1.e1 FROM pm3.g1 ORDER BY e1", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), // $NON-NLS-1$
new String[] { "SELECT pm3.g1.e1 FROM pm3.g1 ORDER BY pm3.g1.e1" });
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testExistsSubquery1.
@Test
public void testExistsSubquery1() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"Select e1 from pm1.g1 where exists (select e1 FROM pm2.g1)", // $NON-NLS-1$
example1(), // $NON-NLS-1$
new String[] { "SELECT e1 FROM pm1.g1" });
checkNodeTypes(plan, new int[] { // Access
1, // DependentAccess
0, // DependentSelect
1, // DependentProject
0, // DupRemove
0, // Grouping
0, // NestedLoopJoinStrategy
0, // MergeJoinStrategy
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 testCantPushJoin2.
@Test
public void testCantPushJoin2() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT a.e1, b.e2 FROM pm1.g1 a, pm1.g2 b, pm2.g1 c WHERE a.e1 = b.e1 AND b.e1 = c.e1", RealMetadataFactory.example1Cached(), null, TestOptimizer.getGenericFinder(false), new String[] { // $NON-NLS-1$
"SELECT a.e1 FROM pm1.g1 AS a", // $NON-NLS-1$
"SELECT b.e1, b.e2 FROM pm1.g2 AS b", // $NON-NLS-1$
"SELECT c.e1 FROM pm2.g1 AS c" }, SHOULD_SUCCEED);
checkNodeTypes(plan, new int[] { // Access
3, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
0, // NestedLoopJoinStrategy
0, // MergeJoinStrategy
2, // Null
0, // PlanExecution
0, // Project
1, // Select
0, // Sort
0, // UnionAll
0 });
}
Aggregations