Author: shawkins
Date: 2012-04-26 21:59:29 -0400 (Thu, 26 Apr 2012)
New Revision: 4039
Modified:
branches/8.0.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java
branches/8.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
branches/8.0.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
Log:
TEIID-1960 fix for incorrect projection in multi-source
Modified:
branches/8.0.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java
===================================================================
---
branches/8.0.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2012-04-26
19:58:31 UTC (rev 4038)
+++
branches/8.0.x/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2012-04-27
01:59:29 UTC (rev 4039)
@@ -281,5 +281,11 @@
return command;
}
+
+ @Override
+ protected boolean minimizeProject() {
+ //running minimize twice is not allowed as the original command is modified
+ return false;
+ }
}
Modified:
branches/8.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
---
branches/8.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2012-04-26
19:58:31 UTC (rev 4038)
+++
branches/8.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2012-04-27
01:59:29 UTC (rev 4039)
@@ -326,7 +326,7 @@
}
}
aNode.setCommand(command);
- if (!aNode.isShouldEvaluate()) {
+ if (minimizeProject() && !aNode.isShouldEvaluate()) {
aNode.minimizeProject(command);
}
setRoutingName(aNode, node);
@@ -576,5 +576,9 @@
throw new QueryPlannerException(QueryPlugin.Event.TEIID30251, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30251));
}
}
+
+ protected boolean minimizeProject() {
+ return true;
+ }
}
Modified:
branches/8.0.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
===================================================================
---
branches/8.0.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2012-04-26
19:58:31 UTC (rev 4038)
+++
branches/8.0.x/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2012-04-27
01:59:29 UTC (rev 4039)
@@ -232,6 +232,23 @@
helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
}
+ @Test public void testMultiReplacementWithProjectConstantLimit() throws Exception {
+ final QueryMetadataInterface metadata =
RealMetadataFactory.exampleMultiBinding();
+ final String userSql = "SELECT a, b, source_name || a, '1' FROM
MultiModel.Phys"; //$NON-NLS-1$
+ final String multiModel = "MultiModel"; //$NON-NLS-1$
+ final int sources = 2;
+ final List<?>[] expected = new List<?>[] {
+ Arrays.asList("x", "z", "ax", "1"),
+ };
+ final HardcodedDataManager dataMgr = new HardcodedDataManager();
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('a', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {
+ Arrays.asList("x", "z", "ax")});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ dataMgr.addData("SELECT g_0.a, g_0.b, concat('b', g_0.a) FROM
MultiModel.Phys AS g_0", //$NON-NLS-1$
+ new List<?>[] {});
+ helpTestMultiSourcePlan(metadata, userSql, multiModel, sources, dataMgr,
expected, RealMetadataFactory.exampleMultiBindingVDB());
+ }
+
@Test public void testMultiDependentJoin() throws Exception {
QueryMetadataInterface metadata = RealMetadataFactory.exampleMultiBinding();
Show replies by date