Author: daijy
Date: Sat Apr 17 00:40:23 2010
New Revision: 935102

URL: http://svn.apache.org/viewvc?rev=935102&view=rev
Log:
PIG-1374: PushDownForeachFlatten shall not push ForEach below Join if the 
flattened fields is used in the next statement

Modified:
    
hadoop/pig/branches/branch-0.7/src/org/apache/pig/impl/logicalLayer/optimizer/PushDownForeachFlatten.java

Modified: 
hadoop/pig/branches/branch-0.7/src/org/apache/pig/impl/logicalLayer/optimizer/PushDownForeachFlatten.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.7/src/org/apache/pig/impl/logicalLayer/optimizer/PushDownForeachFlatten.java?rev=935102&r1=935101&r2=935102&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.7/src/org/apache/pig/impl/logicalLayer/optimizer/PushDownForeachFlatten.java
 (original)
+++ 
hadoop/pig/branches/branch-0.7/src/org/apache/pig/impl/logicalLayer/optimizer/PushDownForeachFlatten.java
 Sat Apr 17 00:40:23 2010
@@ -191,10 +191,12 @@ public class PushDownForeachFlatten exte
             if (requiredFields.getFields()!=null) {
                 for (Pair<Integer, Integer> pair : requiredFields.getFields()) 
{
                     Collection<Column> columns = 
foreachMappedFields.get(pair.second);
-                    for (Column column : columns) {
-                        Pair<Integer, Integer> foreachInputColumn = 
column.getInputColumn();
-                        if 
(foreach.isInputFlattened(foreachInputColumn.second))
-                            return false;
+                    if (columns!=null) {
+                        for (Column column : columns) {
+                            Pair<Integer, Integer> foreachInputColumn = 
column.getInputColumn();
+                            if 
(foreach.isInputFlattened(foreachInputColumn.second))
+                                return false;
+                        }
                     }
                 }
             }


Reply via email to