Author: daijy
Date: Thu Oct 15 18:21:18 2009
New Revision: 825601

URL: http://svn.apache.org/viewvc?rev=825601&view=rev
Log:
PIG-1024: Script contains nested limit fail due to "LOLimit does not support 
multiple outputs"

Modified:
    hadoop/pig/trunk/CHANGES.txt
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLimit.java
    hadoop/pig/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=825601&r1=825600&r2=825601&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Thu Oct 15 18:21:18 2009
@@ -75,6 +75,8 @@
 
 PIG-921: Strange use case for Join which produces different results in local 
and map reduce mode (daijy)
 
+PIG-1024: Script contains nested limit fail due to "LOLimit does not support 
multiple outputs" (daijy)
+
 Release 0.5.0 - Unreleased
 
 INCOMPATIBLE CHANGES

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLimit.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLimit.java?rev=825601&r1=825600&r2=825601&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLimit.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLimit.java Thu Oct 
15 18:21:18 2009
@@ -86,7 +86,7 @@
 
     @Override
     public boolean supportsMultipleOutputs() {
-        return false;
+        return true;
     }
 
     @Override

Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java?rev=825601&r1=825600&r2=825601&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java 
(original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java Thu 
Oct 15 18:21:18 2009
@@ -2059,6 +2059,13 @@
         buildPlan("a = foreach (load 'b') generate (([],[]));");
     }
 
+    @Test
+    // See PIG-1024, shall not throw exception
+    public void testLimitMultipleOutput() {
+        buildPlan(" a = load '1.txt' as (a0:int, a1:int, a2:int);");
+        buildPlan(" b = group a by a0;");
+        buildPlan(" c = foreach b { c1 = limit a 10;c2 = (c1.a0/c1.a1);c3 = 
(c1.a0/c1.a2);generate c2, c3;};");
+    }
     
     private void printPlan(LogicalPlan lp) {
         LOPrinter graphPrinter = new LOPrinter(System.err, lp);


Reply via email to