pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1684305 - /pig/branches/spark/test/org/apache/pig/test/TestCase.java
Date Tue, 09 Jun 2015 02:01:28 GMT
Author: xuefu
Date: Tue Jun  9 02:01:27 2015
New Revision: 1684305

URL: http://svn.apache.org/r1684305
Log:
PIG-4589: Fix unit test failure in TestCase (Xianda via Xuefu)

Modified:
    pig/branches/spark/test/org/apache/pig/test/TestCase.java

Modified: pig/branches/spark/test/org/apache/pig/test/TestCase.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/TestCase.java?rev=1684305&r1=1684304&r2=1684305&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/test/TestCase.java (original)
+++ pig/branches/spark/test/org/apache/pig/test/TestCase.java Tue Jun  9 02:01:27 2015
@@ -29,6 +29,7 @@ import org.apache.pig.PigServer;
 import org.apache.pig.builtin.mock.Storage.Data;
 import org.apache.pig.data.Tuple;
 import org.apache.pig.impl.logicalLayer.FrontendException;
+import org.apache.pig.impl.logicalLayer.schema.Schema;
 import org.junit.Test;
 
 public class TestCase {
@@ -267,10 +268,14 @@ public class TestCase {
         pigServer.registerQuery("STORE C INTO 'bar' USING mock.Storage();");
 
         List<Tuple> out = data.get("bar");
-        assertEquals(3, out.size());
-        assertEquals(tuple(1, "3n+1", bag(tuple("a","x"), tuple("a","y"))), out.get(0));
-        assertEquals(tuple(2, "3n+2", bag(tuple("b","x"), tuple("b","y"))), out.get(1));
-        assertEquals(tuple(3, "3n",   bag(tuple("c","x"), tuple("c","y"))), out.get(2));
+
+        String[] expected = new String[] {
+                "(1,3n+1,{(a,x),(a,y)})",
+                "(2,3n+2,{(b,x),(b,y)})",
+                "(3,3n,{(c,x),(c,y)})"
+        };
+        Schema s = pigServer.dumpSchema("C");
+        Util.checkQueryOutputsAfterSortRecursive(out.iterator(), expected, org.apache.pig.newplan.logical.Util.translateSchema(s));
     }
 
     /**



Mime
View raw message