Author: xuefu
Date: Thu Mar 31 02:31:31 2016
New Revision: 1737173

URL: http://svn.apache.org/viewvc?rev=1737173&view=rev
Log:
PIG-4842: Collected group doesn't work in some cases (Xianda via Xuefu)

Modified:
    
pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/converter/CollectedGroupConverter.java

Modified: 
pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/converter/CollectedGroupConverter.java
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/converter/CollectedGroupConverter.java?rev=1737173&r1=1737172&r2=1737173&view=diff
==============================================================================
--- 
pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/converter/CollectedGroupConverter.java
 (original)
+++ 
pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/converter/CollectedGroupConverter.java
 Thu Mar 31 02:31:31 2016
@@ -73,6 +73,16 @@ public class CollectedGroupConverter imp
 
                         @Override
                         protected Result getNextResult() throws ExecException {
+
+                            // if endOfAllInput was set as true by the 
predecessors, but input.hasNext() is true.
+                            // it means that the predecessor has consumed all 
of its input,
+                            // but poCollectedGroup still hasn't consumed all 
of its input.
+                            //
+                            // set endOfAllInput as false here, so that 
POCollectedGroup.getNextTuple() can work correctly
+                            if (poCollectedGroup.getParentPlan().endOfAllInput 
&& input.hasNext()) {
+                                poCollectedGroup.getParentPlan().endOfAllInput 
= false;
+                            }
+
                             return poCollectedGroup.getNextTuple();
                         }
 


Reply via email to