Author: daijy
Date: Wed Feb  4 22:14:47 2015
New Revision: 1657426

URL: http://svn.apache.org/r1657426
Log:
PIG-4410: Fix testRankWithEmptyReduce in tez mode

Modified:
    pig/trunk/CHANGES.txt
    
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java
    pig/trunk/src/org/apache/pig/impl/builtin/GetMemNumRows.java

Modified: pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1657426&r1=1657425&r2=1657426&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Feb  4 22:14:47 2015
@@ -48,6 +48,8 @@ PIG-4333: Split BigData tests into multi
  
 BUG FIXES
 
+PIG-4410: Fix testRankWithEmptyReduce in tez mode (daijy)
+
 PIG-4392: RANK BY fails when default_parallel is greater than cardinality of 
field being ranked by (daijy)
 
 PIG-4403: Combining -Dpig.additional.jars.uris with -useHCatalog breaks due to 
combination

Modified: 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java
URL: 
http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java?rev=1657426&r1=1657425&r2=1657426&view=diff
==============================================================================
--- 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java
 (original)
+++ 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java
 Wed Feb  4 22:14:47 2015
@@ -156,7 +156,7 @@ public class POReservoirSample extends P
     }
 
     private Result retrieveSample() throws ExecException {
-        if(nextSampleIdx < samples.length){
+        if(nextSampleIdx < Math.min(rowProcessed, samples.length)){
             if (illustrator != null) {
                 illustratorMarkup(samples[nextSampleIdx].result, 
samples[nextSampleIdx].result, 0);
             }

Modified: pig/trunk/src/org/apache/pig/impl/builtin/GetMemNumRows.java
URL: 
http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/impl/builtin/GetMemNumRows.java?rev=1657426&r1=1657425&r2=1657426&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/impl/builtin/GetMemNumRows.java (original)
+++ pig/trunk/src/org/apache/pig/impl/builtin/GetMemNumRows.java Wed Feb  4 
22:14:47 2015
@@ -56,6 +56,7 @@ public class GetMemNumRows extends EvalF
         int tSize = in.size();
        if(tSize >=2 && 
            PoissonSampleLoader.NUMROWS_TUPLE_MARKER.equals(in.get(tSize-2)) ){
+           memSize = 0;
            numRows = (Long)in.get(tSize-1);
        }
        


Reply via email to