use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testPushDistinctVirtual9.
@Test
public void testPushDistinctVirtual9() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select DISTINCT * from vm1.g14 ORDER BY e1", // $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 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 testPushDistinctSort.
@Test
public void testPushDistinctSort() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select distinct e1 from pm3.g1 order by e1", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), // $NON-NLS-1$
new String[] { "SELECT DISTINCT e1 FROM pm3.g1 ORDER BY e1" });
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testCase6364.
@Test
public void testCase6364() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_FUNCTIONS_IN_GROUP_BY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
// $NON-NLS-1$
caps.setFunctionSupport("+", true);
// $NON-NLS-1$
capFinder.addCapabilities("BQT1", caps);
// $NON-NLS-1$
String sql = "select * from (SELECT 1+ SUM(intnum) AS s FROM bqt1.smalla) a WHERE a.s>10";
ProcessorPlan plan = helpPlan(sql, RealMetadataFactory.exampleBQTCached(), null, capFinder, new String[] { "SELECT (1 + SUM(intnum)) FROM bqt1.smalla HAVING SUM(intnum) > 9" }, // $NON-NLS-1$
TestOptimizer.SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testUnionAllPushdownVirtualGroup2.
@Test
public void testUnionAllPushdownVirtualGroup2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
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$
capFinder.addCapabilities("pm3", caps);
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"SELECT e2 FROM vm1.g17", // $NON-NLS-1$
RealMetadataFactory.example1Cached(), null, capFinder, // $NON-NLS-1$
new String[] { "SELECT pm3.g1.e2 FROM pm3.g1 UNION ALL SELECT pm3.g2.e2 FROM pm3.g2" }, SHOULD_SUCCEED);
checkNodeTypes(plan, FULL_PUSHDOWN);
}
use of org.teiid.query.processor.ProcessorPlan in project teiid by teiid.
the class TestOptimizer method testCrossJoinNoElementCriteriaOptimization2.
/**
* This tests that a criteria with no elements is not pushed down,
* but instead is cleaned up properly later
* See defect 9865
*/
@Test
public void testCrossJoinNoElementCriteriaOptimization2() {
ProcessorPlan plan = helpPlan(// $NON-NLS-1$
"select Y.e1, Y.e2 FROM vm1.g1 X, vm1.g1 Y where {b'true'} = {b'true'}", // $NON-NLS-1$
example1(), // $NON-NLS-1$ //$NON-NLS-2$
new String[] { "SELECT 1 FROM pm1.g1 AS g1__1", "SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1" });
checkNodeTypes(plan, new int[] { // Access
2, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
0, // NestedLoopJoinStrategy
1, // MergeJoinStrategy
0, // Null
0, // PlanExecution
0, // Project
1, // Select
0, // Sort
0, // UnionAll
0 });
}
Aggregations