Author: shawkins
Date: 2010-07-27 00:36:53 -0400 (Tue, 27 Jul 2010)
New Revision: 2376
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
Log:
TEIID-1167 adding projection support to temp tables, this also cuts down on the number of
columns that need buffered
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-07-27
02:54:36 UTC (rev 2375)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-07-27
04:36:53 UTC (rev 2376)
@@ -36,7 +36,6 @@
import org.teiid.core.id.IntegerID;
import org.teiid.core.id.IntegerIDFactory;
import org.teiid.core.util.Assertion;
-import org.teiid.language.TableReference;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -468,7 +467,7 @@
return aNode;
}
GroupSymbol group = node.getGroups().iterator().next();
- if (!group.isTempTable() &&
!CoreConstants.SYSTEM_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID()))))
{
+ if
(!CoreConstants.SYSTEM_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID()))))
{
return aNode;
}
List projectSymbols = (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS);
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-07-27
02:54:36 UTC (rev 2375)
+++
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-07-27
04:36:53 UTC (rev 2376)
@@ -357,7 +357,7 @@
return result;
}
- protected List<?> projectTuple(int[] indexes, List<?> tupleValues) {
+ public static List<?> projectTuple(int[] indexes, List<?> tupleValues) {
List<Object> projectedTuple = new ArrayList<Object>(indexes.length);
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2010-07-27 02:54:36
UTC (rev 2375)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2010-07-27 04:36:53
UTC (rev 2376)
@@ -164,17 +164,34 @@
this.sessionID = sessionID;
}
- public TupleSource createTupleSource(List<Criteria> conditions, OrderBy orderBy)
throws TeiidComponentException {
+ public TupleSource createTupleSource(List<SingleElementSymbol> projectedCols,
List<Criteria> conditions, OrderBy orderBy) throws TeiidComponentException {
TupleBrowser browser = createTupleBrower(conditions, orderBy);
- TupleBuffer tb = bm.createTupleBuffer(columns, sessionID, TupleSourceType.PROCESSOR);
+ TupleBuffer tb = bm.createTupleBuffer(getColumns(), sessionID,
TupleSourceType.PROCESSOR);
+ Map map = RelationalNode.createLookupMap(getColumns());
+ int[] indexes = RelationalNode.getProjectionIndexes(map, projectedCols);
+ boolean project = false;
+ if (indexes.length == getColumns().size()) {
+ for (int i = 0; i < indexes.length; i++) {
+ if (indexes[i] != i) {
+ project = true;
+ break;
+ }
+ }
+ } else {
+ project = true;
+ }
List next = null;
while ((next = browser.next()) != null) {
if (rowId != null) {
next = next.subList(1, next.size());
}
+ if (project) {
+ next = RelationalNode.projectTuple(indexes, next);
+ }
tb.addTuple(next);
}
tb.close();
+ tb.setForwardOnly(true);
return tb.createIndexedTupleSource(true);
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-07-27
02:54:36 UTC (rev 2375)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-07-27
04:36:53 UTC (rev 2376)
@@ -51,10 +51,12 @@
import org.teiid.query.sql.lang.ProcedureContainer;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.Update;
+import org.teiid.query.sql.navigator.PostOrderNavigator;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
/**
* @since 5.5
@@ -83,18 +85,16 @@
}
List<ElementSymbol> columns = create.getColumns();
- boolean hasKey = !create.getPrimaryKey().isEmpty();
+ //add metadata
+ TempMetadataID id = tempMetadataStore.addTempGroup(tempTableName, columns, false,
true);
+ TempTableResolver.addPrimaryKey(create, id);
columns = new ArrayList<ElementSymbol>(create.getColumns());
-
- if (hasKey) {
+ if (!create.getPrimaryKey().isEmpty()) {
//reorder the columns to put the key in front
List<ElementSymbol> primaryKey = create.getPrimaryKey();
columns.removeAll(primaryKey);
columns.addAll(0, primaryKey);
- }
- //add metadata
- TempMetadataID id = tempMetadataStore.addTempGroup(tempTableName, columns, false,
true);
- TempTableResolver.addPrimaryKey(create, id);
+ }
TempTable tempTable = new TempTable(buffer, columns,
create.getPrimaryKey().size(), sessionID);
groupToTupleSourceID.put(tempTableName, tempTable);
}
@@ -119,7 +119,18 @@
return null;
}
TempTable table = getTempTable(group.getNonCorrelationName().toUpperCase(),
command);
- return
table.createTupleSource(Criteria.separateCriteriaByAnd(query.getCriteria()),
query.getOrderBy());
+ //convert to the actual table symbols (this is typically handled by the
languagebridgefactory
+ ExpressionMappingVisitor emv = new ExpressionMappingVisitor(null) {
+ @Override
+ public Expression replaceExpression(Expression element) {
+ if (element instanceof ElementSymbol) {
+ ((ElementSymbol) element).setName(((ElementSymbol)
element).getOutputName());
+ }
+ return element;
+ }
+ };
+ PostOrderNavigator.doVisit(query.getSelect(), emv);
+ return table.createTupleSource(command.getProjectedSymbols(),
Criteria.separateCriteriaByAnd(query.getCriteria()), query.getOrderBy());
}
if (command instanceof ProcedureContainer) {
GroupSymbol group = ((ProcedureContainer)command).getGroup();
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2010-07-27
02:54:36 UTC (rev 2375)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2010-07-27
04:36:53 UTC (rev 2376)
@@ -43,10 +43,10 @@
private TempTableDataManager dataManager;
private void execute(String sql, List[] expectedResults) throws Exception {
- execute(expectedResults, TestProcessor.helpGetPlan(sql, metadata));
+ execute(TestProcessor.helpGetPlan(sql, metadata), expectedResults);
}
- private void execute(List[] expectedResults, ProcessorPlan processorPlan) throws
Exception {
+ private void execute(ProcessorPlan processorPlan, List[] expectedResults) throws
Exception {
TestProcessor.doProcess(processorPlan, dataManager, expectedResults,
TestProcessor.createCommandContext());
}
@@ -136,4 +136,11 @@
assertEquals(1, (metadata.getElementIDsInKey(c.iterator().next()).size()));
}
+ @Test public void testProjection() throws Exception {
+ execute("create local temporary table x (e1 string, e2 integer, primary key
(e2))", new List[] {Arrays.asList(0)}); //$NON-NLS-1$
+ execute("insert into x (e2, e1) values (1, 'one')", new List[]
{Arrays.asList(1)}); //$NON-NLS-1$
+ execute("select * from x where e2 = 1", new List[]
{Arrays.asList("one", 1)}); //$NON-NLS-1$
+ execute("select e2, e1 from x where e2 = 1", new List[] {Arrays.asList(1,
"one")}); //$NON-NLS-1$
+ }
+
}
Modified:
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2010-07-27
02:54:36 UTC (rev 2375)
+++
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2010-07-27
04:36:53 UTC (rev 2376)
@@ -22,10 +22,13 @@
package org.teiid.query.processor.xml;
+import static org.junit.Assert.*;
+
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import org.junit.Test;
import org.teiid.client.metadata.ParameterInfo;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.types.DataTypeManager;
@@ -38,23 +41,14 @@
import org.teiid.query.optimizer.relational.rules.RuleChooseDependent;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorPlan;
-import org.teiid.query.processor.xml.ExecSqlInstruction;
-import org.teiid.query.processor.xml.ExecStagingTableInstruction;
-import org.teiid.query.processor.xml.XMLPlan;
import org.teiid.query.unittest.FakeMetadataFacade;
import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.FakeMetadataObject;
import org.teiid.query.unittest.FakeMetadataStore;
-import junit.framework.TestCase;
+public class TestXMLPlanningEnhancements {
-public class TestXMLPlanningEnhancements extends TestCase {
-
- public TestXMLPlanningEnhancements(String name) {
- super(name);
- }
-
private FakeMetadataFacade getMetadata(String query) {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata();
@@ -172,7 +166,7 @@
return doc;
}
- public void testBaseballPlayersDocDefect19541() throws Exception {
+ @Test public void testBaseballPlayersDocDefect19541() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleCase3225();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerCase3225(metadata);
@@ -221,7 +215,7 @@
}
- public void testNested2WithContextCriteria5c() throws Exception {
+ @Test public void testNested2WithContextCriteria5c() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
String resultFile =
"TestXMLProcessor-testNested2WithContextCriteria5c.xml"; //$NON-NLS-1$
@@ -230,7 +224,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc9 WHERE
NOT(SupplierID='52') AND (OrderID='5' OR OrderID='2')",
expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testNested2WithContextCriteria5d() throws Exception {
+ @Test public void testNested2WithContextCriteria5d() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
String resultFile =
"TestXMLProcessor-testNested2WithContextCriteria5d.xml"; //$NON-NLS-1$
@@ -239,7 +233,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc9 WHERE
OrderID='5' OR context(SupplierID, OrderID)='2'", expectedDoc,
metadata, dataMgr); //$NON-NLS-1$
}
- public void testNested2WithContextCriteria5d1() throws Exception {
+ @Test public void testNested2WithContextCriteria5d1() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
String resultFile =
"TestXMLProcessor-testNested2WithContextCriteria5d.xml"; //$NON-NLS-1$
@@ -248,7 +242,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc9 WHERE
context(SupplierID, OrderID)='5' OR OrderID='2'", expectedDoc,
metadata, dataMgr); //$NON-NLS-1$
}
- public void testNested2WithContextCriteria5e() throws Exception {
+ @Test public void testNested2WithContextCriteria5e() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
String resultFile =
"TestXMLProcessor-testNested2WithContextCriteria5e.xml"; //$NON-NLS-1$
@@ -257,7 +251,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc9 WHERE
OrderID='5' OR SupplierID='52'", expectedDoc, metadata, dataMgr);
//$NON-NLS-1$
}
- public void testXQTChoice_6796() throws Exception {
+ @Test public void testXQTChoice_6796() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata2();
FakeDataManager dataMgr = TestXMLProcessor.exampleXQTDataManager(metadata);
String resultFile = "TestXMLProcessor-testXQTChoice_6796.xml";
//$NON-NLS-1$
@@ -266,7 +260,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xqttest.doc4 WHERE
root.key.keys.nestedkey = 4", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testOrderByWithChoiceCriteriaElement() throws Exception {
+ @Test public void testOrderByWithChoiceCriteriaElement() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata2();
FakeDataManager dataMgr = TestXMLProcessor.exampleXQTDataManager(metadata);
String expectedDoc = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n<root>\n <wrapper/>\n
<wrapper/>\n <wrapper/>\n <wrapper/>\n <wrapper/>\n
<wrapper/>\n <wrapper/>\n <wrapper/>\n
<wrapper/>\n</root>"; //$NON-NLS-1$
@@ -274,7 +268,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xqttest.doc5 order by
root.wrapper.key", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testXQTChoice_withContextCriteria() throws Exception {
+ @Test public void testXQTChoice_withContextCriteria() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata2();
FakeDataManager dataMgr = TestXMLProcessor.exampleXQTDataManager(metadata);
String resultFile =
"TestXMLProcessor-testXQTChoice_withContextCriteria.xml"; //$NON-NLS-1$
@@ -283,7 +277,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xqttest.doc4 WHERE
context(root.key.keys.nestedkey, root.key.keys.nestedkey) = 4", expectedDoc,
metadata, dataMgr); //$NON-NLS-1$
}
- public void testXQTChoice_withContextCriteria1() throws Exception {
+ @Test public void testXQTChoice_withContextCriteria1() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata2();
FakeDataManager dataMgr = TestXMLProcessor.exampleXQTDataManager(metadata);
String resultFile =
"TestXMLProcessor-testXQTChoice_withContextCriteria1.xml"; //$NON-NLS-1$
@@ -292,7 +286,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xqttest.doc4 WHERE
context(root.key.keys.nestedkey, root.key.keys.nestedkey) = 4 and
context(root.wrapper.key.keys.nestedkey, root.wrapper.key.keys.nestedkey) = 3",
expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testMappingClassWithInlineViewAndCriteria() throws Exception {
+ @Test public void testMappingClassWithInlineViewAndCriteria() throws Exception {
FakeMetadataFacade metadata = getMetadata("SELECT upper(x.supplierNum) as
supplierNum, x.supplierName, x.supplierZipCode from (select stock.suppliers.supplierNum,
supplierName, supplierZipCode, itemNum FROM stock.suppliers, stock.item_supplier WHERE
stock.suppliers.supplierNum = stock.item_supplier.supplierNum) x where x.itemNum =
?"); //$NON-NLS-1$
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -301,7 +295,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc18a where
supplierID<56", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testMappingClassWithUnionAndCriteria() throws Exception {
+ @Test public void testMappingClassWithUnionAndCriteria() throws Exception {
FakeMetadataFacade metadata = getMetadata("SELECT
concat(stock.suppliers.supplierNum, '') as supplierNum, supplierName,
supplierZipCode FROM stock.suppliers, stock.item_supplier WHERE
stock.suppliers.supplierNum = stock.item_supplier.supplierNum AND
stock.item_supplier.itemNum = ? union all SELECT concat(stock.suppliers.supplierNum,
'1'), supplierName, convert(12345, string) FROM stock.suppliers WHERE
stock.suppliers.supplierNum = ?"); //$NON-NLS-1$
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -310,7 +304,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc18a where
supplierID<56", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testMappingClassWithInputSetElementNameConflict() throws Exception {
+ @Test public void testMappingClassWithInputSetElementNameConflict() throws Exception
{
FakeMetadataFacade metadata = getMetadata("SELECT
concat(stock.suppliers.supplierNum, '') as supplierNum, supplierName,
supplierZipCode FROM stock.suppliers, stock.item_supplier WHERE
stock.suppliers.supplierNum = stock.item_supplier.supplierNum AND
stock.item_supplier.supplierNum = ?"); //$NON-NLS-1$
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -318,7 +312,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc18a where
supplierID<56", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void testAutoStagingFailsForMappingClassWithProcRelational() throws Exception
{
+ @Test public void testAutoStagingFailsForMappingClassWithProcRelational() throws
Exception {
FakeMetadataFacade metadata = getMetadata("SELECT supplierNum, supplierName,
supplierZipCode FROM v1.supplierProc where itemnum = ?"); //$NON-NLS-1$
FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1");
//$NON-NLS-1$
@@ -341,7 +335,7 @@
assertNull(stats.get(ExecStagingTableInstruction.class));
}
- public void testMappingClassWitSelectDistinctAndCriteria() throws Exception {
+ @Test public void testMappingClassWitSelectDistinctAndCriteria() throws Exception {
FakeMetadataFacade metadata = getMetadata("SELECT distinct '1' as
supplierNum, '2' as supplierName, '3' as supplierZipCode FROM
stock.suppliers, stock.item_supplier WHERE stock.suppliers.supplierNum =
stock.item_supplier.supplierNum AND stock.item_supplier.itemNum like substring(?,1,1) ||
'%'"); //$NON-NLS-1$
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -357,7 +351,7 @@
* Ensures that correlated references to outer scoped groups can
* be used as inputs
*/
- public void testMappingClassWithStoredProcedureAndCriteria() throws Exception {
+ @Test public void testMappingClassWithStoredProcedureAndCriteria() throws Exception
{
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
String expectedDoc =
TestXMLProcessor.readFile("TestXMLPlanningEnhancements-testMappingClassWithStoredProcedureAndCriteria.xml");
//$NON-NLS-1$
@@ -376,7 +370,7 @@
/**
* @see #testNested2WithCriteria2
*/
- public void testAutoStagingByCosting() throws Exception {
+ @Test public void testAutoStagingByCosting() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
FakeMetadataObject suppliers =
metadata.getStore().findObject("stock.suppliers", FakeMetadataObject.GROUP);
//$NON-NLS-1$
@@ -397,7 +391,7 @@
/**
* @see #testNested2WithCriteria2
*/
- public void testAutoStagingFailsByCosting() throws Exception {
+ @Test public void testAutoStagingFailsByCosting() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
FakeMetadataObject suppliers =
metadata.getStore().findObject("stock.suppliers", FakeMetadataObject.GROUP);
//$NON-NLS-1$
@@ -415,7 +409,7 @@
assertNull(stats.get(ExecStagingTableInstruction.class));
}
- public void testAutoStagingFailsByNoCache() throws Exception {
+ @Test public void testAutoStagingFailsByNoCache() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -428,7 +422,7 @@
assertNull(stats.get(ExecStagingTableInstruction.class));
}
- public void testAutoStagingFailsByNoCacheByGroup() throws Exception {
+ @Test public void testAutoStagingFailsByNoCacheByGroup() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -448,7 +442,7 @@
}
// see the next test with costing information too.
- public void testUseOfStagingCardinalityOnDependentJoinsNoCost() throws Exception {
+ @Test public void testUseOfStagingCardinalityOnDependentJoinsNoCost() throws
Exception {
FakeMetadataFacade metadata = getTempTableMetadata(false);
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -473,7 +467,7 @@
1, // MergeJoin (**We are merge join with out any costing info**)
0, // Null
0, // PlanExecution
- 2, // Project
+ 1, // Project
1, // Select
0, // Sort
0 // UnionAll
@@ -482,7 +476,7 @@
TestOptimizer.checkDependentJoinCount(plan, 0);
}
- public void testUseOfStagingCardinalityOnDependentJoinsWithCost() throws Exception {
+ @Test public void testUseOfStagingCardinalityOnDependentJoinsWithCost() throws
Exception {
FakeMetadataFacade metadata = getTempTableMetadata(false);
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
FakeMetadataObject orders =
metadata.getStore().findObject("stock.orders", FakeMetadataObject.GROUP);
//$NON-NLS-1$
@@ -512,7 +506,7 @@
1, // MergeJoin (**We are merge join with out any costing info**)
0, // Null
0, // PlanExecution
- 2, // Project
+ 1, // Project
1, // Select
0, // Sort
0 // UnionAll
@@ -521,7 +515,7 @@
TestOptimizer.checkDependentJoinCount(plan, 1);
}
- public void testNoRedundentStagingTables() throws Exception {
+ @Test public void testNoRedundentStagingTables() throws Exception {
FakeMetadataFacade metadata = getTempTableMetadata(true);
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
FakeMetadataObject suppliers =
metadata.getStore().findObject("stock.suppliers", FakeMetadataObject.GROUP);
//$NON-NLS-1$
@@ -538,7 +532,7 @@
assertEquals(4, ((List)stats.get(ExecStagingTableInstruction.class)).size());
}
- public void testEmptyMappingClass() throws Exception {
+ @Test public void testEmptyMappingClass() throws Exception {
FakeMetadataFacade metadata = TestXMLProcessor.exampleMetadata();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
FakeMetadataObject suppliers =
metadata.getStore().findObject("xmltest.suppliers", FakeMetadataObject.GROUP);
//$NON-NLS-1$