use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testAggregateWithoutGroupBy.
@Test
public void testAggregateWithoutGroupBy() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select count(e2) from pm1.g1", // $NON-NLS-1$
example1(), // $NON-NLS-1$
new String[] { "SELECT e2 FROM pm1.g1" });
checkNodeTypes(plan, new int[] { // Access
1, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
1, // 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 testPushDistinctVirtual5.
@Test
public void testPushDistinctVirtual5() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select DISTINCT * from vm1.g13", // $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 testHavingAndGroupBy.
@Test
public void testHavingAndGroupBy() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select e1, count(e2) from pm1.g1 group by e1 having count(e2) > 0 and sum(e2) > 0", // $NON-NLS-1$
example1(), // $NON-NLS-1$
new String[] { "SELECT e1, e2 FROM pm1.g1" });
checkNodeTypes(plan, new int[] { // Access
1, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
1, // NestedLoopJoinStrategy
0, // MergeJoinStrategy
0, // Null
0, // PlanExecution
0, // Project
1, // Select
1, // Sort
0, // UnionAll
0 });
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testLookupFunction2.
/**
* case 5213 - note here that the lookup cannot be pushed down since it is dependent upon an element symbol
*/
@Test
public void testLookupFunction2() throws Exception {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT e1 FROM pm1.g2 WHERE LOOKUP('pm1.g1','e1', 'e2', e2) IS NULL", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), new String[] { "SELECT g_0.e2, g_0.e1 FROM pm1.g2 AS g_0" }, // $NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING);
checkNodeTypes(plan, new int[] { // Access
1, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
0, // NestedLoopJoinStrategy
0, // MergeJoinStrategy
0, // Null
0, // PlanExecution
0, // Project
1, // Select
1, // Sort
0, // UnionAll
0 });
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testPushFunctionInJoin1.
@Test
public void testPushFunctionInJoin1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true);
// $NON-NLS-1$
caps.setFunctionSupport("convert", true);
// $NON-NLS-1$
capFinder.addCapabilities("pm1", caps);
// Add join capability to pm1
QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT pm1.g1.e1, pm1.g2.e3 FROM pm1.g1, pm1.g2 WHERE pm1.g1.e1 = convert(pm1.g2.e2, string) AND upper(pm1.g1.e1) = 'X'", metadata, null, capFinder, // $NON-NLS-1$
new String[] { "SELECT pm1.g1.e1, pm1.g2.e3 FROM pm1.g1, pm1.g2 WHERE (pm1.g1.e1 = convert(pm1.g2.e2, string)) AND (ucase(pm1.g1.e1) = 'X')" }, SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
Aggregations