Author: mdrillin
Date: 2011-05-31 11:50:52 -0400 (Tue, 31 May 2011)
New Revision: 3205
Modified:
branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
Log:
TEIID-1571 - Fix for invalid merge
Modified:
branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
===================================================================
---
branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2011-05-30
09:48:28 UTC (rev 3204)
+++
branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2011-05-31
15:50:52 UTC (rev 3205)
@@ -260,7 +260,7 @@
ExpressionMappingVisitor.mapExpressions(groupBy, symbolMap);
node.setProperty(NodeConstants.Info.GROUP_COLS, groupBy.getSymbols());
if (!singleMapping) {
- GroupsUsedByElementsVisitor.getGroups(groupCols, groups);
+ GroupsUsedByElementsVisitor.getGroups(groupBy, groups);
}
}
} else if (type == NodeConstants.Types.SOURCE || type ==
NodeConstants.Types.ACCESS) {
Modified:
branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
===================================================================
---
branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2011-05-30
09:48:28 UTC (rev 3204)
+++
branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2011-05-31
15:50:52 UTC (rev 3205)
@@ -317,5 +317,16 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+
+ @Test public void testMergeGroupBy() throws Exception {
+ BasicSourceCapabilities caps = TestAggregatePushdown.getAggregateCapabilities();
+ caps.setFunctionSupport("+", true); //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (select c.e1 as x
from (select e1 from pm1.g1) as c, pm1.g2 as d) as a group by x", //$NON-NLS-1$
+ FakeMetadataFactory.example1Cached(), null, new
DefaultCapabilitiesFinder(caps),
+ new String[] {
+ "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2
AS g_1 GROUP BY g_0.e1"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
}
Show replies by date