Author: gates
Date: Wed Sep 24 17:59:20 2008
New Revision: 698786

URL: http://svn.apache.org/viewvc?rev=698786&view=rev
Log:
PIG-454 Fixed CombinerOptimizer to reset state on every MapReduceOper it 
encounters.


Modified:
    
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/CombinerOptimizer.java

Modified: 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/CombinerOptimizer.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/CombinerOptimizer.java?rev=698786&r1=698785&r2=698786&view=diff
==============================================================================
--- 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/CombinerOptimizer.java
 (original)
+++ 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/CombinerOptimizer.java
 Wed Sep 24 17:59:20 2008
@@ -103,6 +103,7 @@
 
     @Override
     public void visitMROp(MapReduceOper mr) throws VisitorException {
+        resetState();
         log.trace("Entering CombinerOptimizer.visitMROp");
         if (mr.reducePlan.isEmpty()) return;
 
@@ -436,4 +437,10 @@
 
     }
 
+    // Reset any member variables since we may have already visited one
+    // combine.
+    private void resetState() {
+        mKeyField = -1;
+        mKeyType = 0;
+    }
 }


Reply via email to