Author: daijy
Date: Wed Jan 20 06:22:30 2010
New Revision: 901081

URL: http://svn.apache.org/viewvc?rev=901081&view=rev
Log:
PIG-1195: POSort should take care of sort order

Modified:
    hadoop/pig/trunk/CHANGES.txt
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java
    hadoop/pig/trunk/test/org/apache/pig/test/TestEvalPipeline2.java

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=901081&r1=901080&r2=901081&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Wed Jan 20 06:22:30 2010
@@ -352,6 +352,8 @@
 
 PIG-1193: Secondary sort issue on nested desc sort (daijy)
 
+PIG-1195: POSort should take care of sort order (daijy)
+
 Release 0.5.0
 
 INCOMPATIBLE CHANGES

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java?rev=901081&r1=901080&r2=901081&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java
 Wed Jan 20 06:22:30 2010
@@ -75,7 +75,7 @@
        private List<Boolean> mAscCols;
        private POUserComparisonFunc mSortFunc;
        transient private final Log log = LogFactory.getLog(getClass());
-       transient private Comparator<Tuple> mComparator;
+       private Comparator<Tuple> mComparator;
 
        private boolean inputsAccumulated = false;
        private long limit;

Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestEvalPipeline2.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestEvalPipeline2.java?rev=901081&r1=901080&r2=901081&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestEvalPipeline2.java (original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestEvalPipeline2.java Wed Jan 20 
06:22:30 2010
@@ -453,4 +453,22 @@
         assertFalse(iter.hasNext());
     }
 
+    // See PIG-1195
+    @Test
+    public void testNestedDescSort() throws Exception{
+        Util.createInputFile(cluster, "table_testNestedDescSort", new 
String[]{"3","4"});
+        pigServer.registerQuery("A = LOAD 'table_testNestedDescSort' as 
(a0:int);");
+        pigServer.registerQuery("B = group A ALL;");
+        pigServer.registerQuery("C = foreach B { D = order A by a0 
desc;generate D;};");
+        Iterator<Tuple> iter = pigServer.openIterator("C");
+        
+        assertTrue(iter.hasNext());
+        Tuple t = iter.next();
+        
+        assertTrue(t.toString().equals("({(4),(3)})"));
+        assertFalse(iter.hasNext());
+        
+        Util.deleteFile(cluster, "table_testNestedDescSort");
+    }
+
 }


Reply via email to