You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by th...@apache.org on 2011/04/14 02:27:08 UTC

svn commit: r1091977 - in /pig/trunk: CHANGES.txt test/org/apache/pig/test/TestProjectStarExpander.java

Author: thejas
Date: Thu Apr 14 00:27:07 2011
New Revision: 1091977

URL: http://svn.apache.org/viewvc?rev=1091977&view=rev
Log:
PIG-1897: multiple star projection in a statement does not produce the right plan (thejas)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/test/org/apache/pig/test/TestProjectStarExpander.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1091977&r1=1091976&r2=1091977&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Apr 14 00:27:07 2011
@@ -147,6 +147,9 @@ PIG-1696: Performance: Use System.arrayc
 
 BUG FIXES
 
+PIG-1897: multiple star projection in a statement does not produce 
+ the right plan (thejas)
+
 PIG-1917: NativeMapReduce does not Allow Configuration Parameters 
  containing Spaces (thejas)
 

Modified: pig/trunk/test/org/apache/pig/test/TestProjectStarExpander.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestProjectStarExpander.java?rev=1091977&r1=1091976&r2=1091977&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestProjectStarExpander.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestProjectStarExpander.java Thu Apr 14 00:27:07 2011
@@ -114,5 +114,33 @@ public class TestProjectStarExpander  {
 
     }
     
+    /**
+     * Test projecting multiple *
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Test
+    public void testProjectStarMulti() throws IOException, ParseException {
+        PigServer pig = new PigServer(ExecType.LOCAL);
+        String query =
+            "  l1 = load '" + INP_FILE_5FIELDS + "' as (a : int, b : int, c : int);"
+            + "f = foreach l1 generate * as (aa, bb, cc), *;"
+        ; 
+
+        Util.registerMultiLineQuery(pig, query);
+       
+        Schema expectedSch = Util.getSchemaFromString(
+                "aa : int, bb : int, cc : int, a : int, b : int, c : int");
+        Schema sch = pig.dumpSchema("f");
+        assertEquals("Checking expected schema", expectedSch, sch);
+        List<Tuple> expectedRes = 
+            Util.getTuplesFromConstantTupleStrings(
+                    new String[] {
+                            "(10,20,30,10,20,30)",
+                            "(11,21,31,11,21,31)",
+                    });
+        Iterator<Tuple> it = pig.openIterator("f");
+        Util.checkQueryOutputsAfterSort(it, expectedRes);
+    }
    
 }