[teiid-commits] teiid SVN: r2670 - in branches/7.1.x/engine/src: test/java/org/teiid/query/processor and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Oct 21 14:18:57 EDT 2010


Author: rareddy
Date: 2010-10-21 14:18:56 -0400 (Thu, 21 Oct 2010)
New Revision: 2670

Modified:
   branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java
   branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
Log:
TEIID-1313: avoid the duplicate row the batch boundaries with nested table join

Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java	2010-10-21 15:33:12 UTC (rev 2669)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java	2010-10-21 18:18:56 UTC (rev 2670)
@@ -126,12 +126,14 @@
 				
 				List<?> outputTuple = outputTuple(this.leftSource.getCurrentTuple(), this.rightSource.getCurrentTuple());
                 
-                if (this.joinNode.matchesCriteria(outputTuple)) {
-                	joinNode.addBatchRow(outputTuple);
-                	outerMatched = true;
-                } 
+                boolean matches = this.joinNode.matchesCriteria(outputTuple);
                 
                 rightSource.saveNext();
+
+                if (matches) {
+                	outerMatched = true;
+                	joinNode.addBatchRow(outputTuple);
+                }
 			}
 			
 			if (!outerMatched && this.joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) {

Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java	2010-10-21 15:33:12 UTC (rev 2669)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java	2010-10-21 18:18:56 UTC (rev 2670)
@@ -198,7 +198,19 @@
         process(sql, expected);
     }
 
-    public static void process(String sql, List[] expectedResults) throws Exception {    
+	@Test public void testTextTableMultiBatch() throws Exception {
+		String sql = "select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x";
+    	
+        List[] expected = new List[] {
+        		Arrays.asList("c"),
+        		Arrays.asList("1"),
+        		Arrays.asList("true"),
+        };    
+
+        process(sql, expected);
+    }   
+	
+	public static void process(String sql, List[] expectedResults) throws Exception {    
     	FakeDataManager dataManager = new FakeDataManager();
         sampleData1(dataManager);
     	ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());



More information about the teiid-commits mailing list