Author: shawkins
Date: 2010-07-14 13:25:17 -0400 (Wed, 14 Jul 2010)
New Revision: 2343
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
Log:
TEIID-1157 fix for ruleplansorts with a table function
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2010-07-14
16:27:29 UTC (rev 2342)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2010-07-14
17:25:17 UTC (rev 2343)
@@ -42,7 +42,6 @@
import org.teiid.query.optimizer.relational.plantree.PlanNode;
import org.teiid.query.processor.relational.JoinNode.JoinStrategyType;
import org.teiid.query.processor.relational.MergeJoinStrategy.SortOption;
-import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.symbol.GroupSymbol;
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2010-07-14
16:27:29 UTC (rev 2342)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2010-07-14
17:25:17 UTC (rev 2343)
@@ -41,7 +41,6 @@
import org.teiid.query.optimizer.relational.plantree.NodeConstants;
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
-import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.lang.OrderByItem;
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2010-07-14
16:27:29 UTC (rev 2342)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2010-07-14
17:25:17 UTC (rev 2343)
@@ -211,6 +211,9 @@
}
private boolean mergeSortWithDupRemoval(PlanNode node) {
+ if (node.getFirstChild() == null) {
+ return false;
+ }
switch (node.getFirstChild().getType()) {
case NodeConstants.Types.SET_OP:
if (node.getFirstChild().getProperty(NodeConstants.Info.SET_OPERATION) ==
SetQuery.Operation.UNION &&
!node.getFirstChild().hasBooleanProperty(NodeConstants.Info.USE_ALL)) {
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java 2010-07-14
16:27:29 UTC (rev 2342)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java 2010-07-14
17:25:17 UTC (rev 2343)
@@ -175,7 +175,17 @@
process(sql, expected);
}
+
+ @Test public void testTextTableGroupBy() throws Exception {
+ String sql = "select max(x) from texttable('a' || ',' ||
'1' COLUMNS x string, y integer) x group by y"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("a"),
+ };
+ process(sql, expected);
+ }
+
public static void process(String sql, List[] expectedResults) throws Exception {
FakeDataManager dataManager = new FakeDataManager();
sampleData1(dataManager);
Show replies by date