Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestProjectionMap.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestProjectionMap.java?rev=777708&r1=777707&r2=777708&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestProjectionMap.java (original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestProjectionMap.java Fri May 22 
20:50:32 2009
@@ -17,51 +17,21 @@
  */
 package org.apache.pig.test;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Random;
-import java.net.URL;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Set;
 
-import junit.framework.AssertionFailedError;
 
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.pig.LoadFunc;
-import org.apache.pig.FuncSpec;
-import org.apache.pig.PigServer;
-import org.apache.pig.backend.datastorage.DataStorage;
 import org.apache.pig.builtin.PigStorage;
-import org.apache.pig.data.DataBag;
-import org.apache.pig.data.Tuple;
-import org.apache.pig.data.TupleFactory;
-import org.apache.pig.impl.PigContext;
-import org.apache.pig.ExecType;
-import org.apache.pig.impl.builtin.GFAny;
-import org.apache.pig.impl.io.BufferedPositionedInputStream;
-import org.apache.pig.impl.io.FileLocalizer;
-import org.apache.pig.impl.plan.OperatorKey;
 import org.apache.pig.impl.plan.ProjectionMap;
 import org.apache.pig.impl.logicalLayer.*;
-import org.apache.pig.impl.logicalLayer.schema.Schema;
-import org.apache.pig.data.DataType;
-import org.apache.pig.impl.logicalLayer.parser.ParseException ;
 import org.apache.pig.impl.util.MultiMap;
 import org.apache.pig.impl.util.Pair;
-import org.apache.pig.test.utils.Identity;
 import org.apache.pig.test.utils.LogicalPlanTester;
-import org.apache.pig.impl.util.LogUtils;
-import org.apache.pig.PigException;
 
 
 public class TestProjectionMap extends junit.framework.TestCase {
@@ -75,6 +45,14 @@
         planTester.reset(); 
     }
 
+    private static final String simpleEchoStreamingCommand;
+    static {
+        if (System.getProperty("os.name").toUpperCase().startsWith("WINDOWS"))
+            simpleEchoStreamingCommand = "perl -ne 'print \\\"$_\\\"'";
+        else
+            simpleEchoStreamingCommand = "perl -ne 'print \"$_\"'";
+    }
+
     
     @Test
     public void testQueryForeach1() {
@@ -91,11 +69,11 @@
         LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
-        assertTrue(foreachProjectionMap.getMappedFileds() == null);
-        assertTrue(foreachProjectionMap.getRemovedFileds() == null);
+        assertTrue(foreachProjectionMap.getMappedFields() == null);
+        assertTrue(foreachProjectionMap.getRemovedFields() == null);
         
         //check that added fields contain [0, 1]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields.size() == 2);
         assertTrue(foreachAddedFields.get(0) == 0);
         assertTrue(foreachAddedFields.get(1) == 1);
@@ -116,11 +94,11 @@
         LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
-        assertTrue(foreachProjectionMap.getMappedFileds() == null);
-        assertTrue(foreachProjectionMap.getRemovedFileds() == null);
+        assertTrue(foreachProjectionMap.getMappedFields() == null);
+        assertTrue(foreachProjectionMap.getRemovedFields() == null);
         
         //check that added fields contain [0, 1]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields.size() == 2);
         assertTrue(foreachAddedFields.get(0) == 0);
         assertTrue(foreachAddedFields.get(1) == 1);
@@ -136,7 +114,7 @@
         ProjectionMap loadaProjectionMap = loada.getProjectionMap();
         assertTrue(loadaProjectionMap == null);
         
-        LOLoad loadb = (LOLoad) lp.getRoots().get(0);
+        LOLoad loadb = (LOLoad) lp.getRoots().get(1);
         ProjectionMap loadbProjectionMap = loadb.getProjectionMap();
         assertTrue(loadbProjectionMap == null);
 
@@ -145,7 +123,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -155,10 +133,10 @@
         assertTrue(mapValues.get(1).second == 1);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -167,11 +145,11 @@
         LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
-        assertTrue(foreachProjectionMap.getMappedFileds() == null);
+        assertTrue(foreachProjectionMap.getMappedFields() == null);
 
         //check that removed fields has all the columns from the input cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
-        assertTrue(foreachProjectionMap.getRemovedFileds().size() == 3);
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
+        assertTrue(foreachProjectionMap.getRemovedFields().size() == 3);
         int expectedColumn = 0;
         for(Pair<Integer, Integer> removedField: foreachRemovedFields) {
             assertTrue(removedField.first == 0);
@@ -179,7 +157,7 @@
         }
         
         //check that added fields contain [0]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields.size() == 1);
         assertTrue(foreachAddedFields.get(0) == 0);
     }
@@ -194,23 +172,19 @@
         ProjectionMap loadaProjectionMap = loada.getProjectionMap();
         assertTrue(loadaProjectionMap == null);
         
-        LOLoad loadb = (LOLoad) lp.getRoots().get(0);
-        ProjectionMap loadbProjectionMap = loadb.getProjectionMap();
-        assertTrue(loadbProjectionMap == null);
-
         //check cogroup projection map
         LOCogroup cogroup = (LOCogroup)lp.getSuccessors(loada).get(0);
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields == null);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [0, 1]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 0);
         assertTrue(cogroupAddedFields.get(1) == 1);
@@ -219,7 +193,7 @@
         LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMappedFields = 
foreachProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMappedFields = 
foreachProjectionMap.getMappedFields();
         assertTrue(foreachMappedFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)foreachMappedFields.get(0);
@@ -228,7 +202,7 @@
 
 
         //check that removed fields has all the columns from the input cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
 
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
@@ -236,7 +210,7 @@
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
 
@@ -250,16 +224,12 @@
         ProjectionMap loadaProjectionMap = loada.getProjectionMap();
         assertTrue(loadaProjectionMap == null);
         
-        LOLoad loadb = (LOLoad) lp.getRoots().get(0);
-        ProjectionMap loadbProjectionMap = loadb.getProjectionMap();
-        assertTrue(loadbProjectionMap == null);
-
         //check cogroup projection map
         LOCogroup cogroup = (LOCogroup)lp.getSuccessors(loada).get(0);
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -267,10 +237,10 @@
         assertTrue(mapValues.get(0).second == 1);
 
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [0, 1]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 1);
         assertTrue(cogroupAddedFields.get(0) == 1);
         
@@ -279,7 +249,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);        
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields != null);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -288,7 +258,7 @@
 
 
         //check that removed fields has all the columns from the input cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
 
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
@@ -296,7 +266,7 @@
         assertTrue(removedField.second == 1);
         
         //check that added fields contain [1]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields != null);
         assertTrue(foreachAddedFields.size() == 1);
         assertTrue(foreachAddedFields.get(0) == 1);
@@ -312,7 +282,7 @@
         ProjectionMap loadaProjectionMap = loada.getProjectionMap();
         assertTrue(loadaProjectionMap == null);
         
-        LOLoad loadb = (LOLoad) lp.getRoots().get(0);
+        LOLoad loadb = (LOLoad) lp.getRoots().get(1);
         ProjectionMap loadbProjectionMap = loadb.getProjectionMap();
         assertTrue(loadbProjectionMap == null);
 
@@ -321,7 +291,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -331,10 +301,10 @@
         assertTrue(mapValues.get(1).second == 1);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -344,7 +314,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields != null);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -356,14 +326,14 @@
         assertTrue(mapValues.get(0).second == 2);
 
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
 
@@ -382,7 +352,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
 
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -392,10 +362,10 @@
         assertTrue(mapValues.get(1).second == 7);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 1);
         assertTrue(cogroupAddedFields.get(0) == 1);
         
@@ -404,7 +374,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields != null);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -416,14 +386,14 @@
         assertTrue(mapValues.get(0).second == 0);
 
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 1);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
 
     }
@@ -445,6 +415,30 @@
     }
     
     @Test
+    public void testQuerySplitNoSchema() {
+        planTester.buildPlan("a = load 'a';");
+        LogicalPlan lp = planTester.buildPlan("split a into b if $0 == '3', c 
if $1 == '3';");
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the split projection map has null mappedFields
+        LOSplit split = (LOSplit)lp.getSuccessors(load).get(0);
+        ProjectionMap splitProjectionMap = split.getProjectionMap();
+        assertTrue(splitProjectionMap == null);
+        
+        LOSplitOutput splitb = (LOSplitOutput)lp.getSuccessors(split).get(0);
+        ProjectionMap splitbProjectionMap = splitb.getProjectionMap();
+        assertTrue(splitbProjectionMap == null);
+        
+        LOSplitOutput splitc = (LOSplitOutput)lp.getSuccessors(split).get(1);
+        ProjectionMap splitcProjectionMap = splitc.getProjectionMap();
+        assertTrue(splitcProjectionMap == null);
+    }
+    
+    @Test
     public void testQueryOrderByNoSchema() {
         planTester.buildPlan("a = load 'a';");
         LogicalPlan lp = planTester.buildPlan("b = order a by $1;");
@@ -461,6 +455,28 @@
     }
     
     @Test
+    public void testQueryLimitNoSchema() {
+        planTester.buildPlan("a = load 'a';");
+        planTester.buildPlan("b = order a by $1;");
+        LogicalPlan lp = planTester.buildPlan("c = limit b 10;");
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the order by projection map is not null
+        LOSort sort = (LOSort)lp.getSuccessors(load).get(0);
+        ProjectionMap sortProjectionMap = sort.getProjectionMap();
+        assertTrue(sortProjectionMap == null);
+        
+        //check that the limit projection map is null
+        LOLimit limit = (LOLimit)lp.getLeaves().get(0);
+        ProjectionMap limitProjectionMap = limit.getProjectionMap();
+        assertTrue(limitProjectionMap == null);
+    }
+    
+    @Test
     public void testQueryDistinctNoSchema() {
         planTester.buildPlan("a = load 'a';");
         LogicalPlan lp = planTester.buildPlan("b = distinct a;");
@@ -477,6 +493,38 @@
     }
     
     @Test
+    public void testQueryStreamingNoSchema() {
+        String query = "stream (load 'a') through `" + 
simpleEchoStreamingCommand + "`;";
+        LogicalPlan lp = planTester.buildPlan(query);
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the stream projection map is null
+        LOStream stream = (LOStream)lp.getLeaves().get(0);
+        ProjectionMap streamProjectionMap = stream.getProjectionMap();
+        assertTrue(streamProjectionMap == null);
+    }
+    
+    @Test
+    public void testQueryStreamingNoSchema1() {
+        String query = "stream (load 'a' as (url, hitCount)) through `" + 
simpleEchoStreamingCommand + "` ;";
+        LogicalPlan lp = planTester.buildPlan(query);
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the stream projection map is null
+        LOStream stream = (LOStream)lp.getLeaves().get(0);
+        ProjectionMap streamProjectionMap = stream.getProjectionMap();
+        assertTrue(streamProjectionMap == null);
+    }
+    
+    @Test
     public void testQueryForeach3() {
         String query = "foreach (load 'a') generate ($1 == '3'? $2 : $3) ;";
         LogicalPlan lp = planTester.buildPlan(query);
@@ -491,11 +539,11 @@
         LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
-        assertTrue(foreachProjectionMap.getMappedFileds() == null);
-        assertTrue(foreachProjectionMap.getRemovedFileds() == null);
+        assertTrue(foreachProjectionMap.getMappedFields() == null);
+        assertTrue(foreachProjectionMap.getRemovedFields() == null);
         
         //check that added fields contain [0]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields.size() == 1);
         assertTrue(foreachAddedFields.get(0) == 0);
     }
@@ -520,7 +568,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> cogroupMapValues = 
(ArrayList<Pair<Integer, Integer>>)cogroupMapFields.get(0);
@@ -530,10 +578,10 @@
         assertTrue(cogroupMapValues.get(1).second == 1);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -543,7 +591,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields();
         assertTrue(foreachMapFields != null);
         
         List<Pair<Integer, Integer>> foreachMapValues = 
(ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -557,14 +605,14 @@
         }
         
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
-        assertTrue(foreachProjectionMap.getRemovedFileds().size() == 1);
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
+        assertTrue(foreachProjectionMap.getRemovedFields().size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
     
@@ -593,7 +641,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> cogroupMapValues = 
(ArrayList<Pair<Integer, Integer>>)cogroupMapFields.get(0);
@@ -603,10 +651,10 @@
         assertTrue(cogroupMapValues.get(1).second == 1);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -616,7 +664,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields();
         assertTrue(foreachMapFields != null);
         
         List<Pair<Integer, Integer>> foreachMapValues = 
(ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -624,8 +672,8 @@
         assertTrue(foreachMapValues.get(0).second == 1);
         
         //check that removed fields has all the columns from the input cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
-        assertTrue(foreachProjectionMap.getRemovedFileds().size() == 2);
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
+        assertTrue(foreachProjectionMap.getRemovedFields().size() == 2);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
@@ -635,7 +683,7 @@
         assertTrue(removedField.second == 2);
 
         //check that added fields contain [0]
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields.size() == 1);
         assertTrue(foreachAddedFields.get(0) == 1);
     }
@@ -723,7 +771,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -733,10 +781,10 @@
         assertTrue(mapValues.get(1).second == 0);
         
         //check the cogroup removed fields is null
-        assertTrue(cogroupProjectionMap.getRemovedFileds() == null);
+        assertTrue(cogroupProjectionMap.getRemovedFields() == null);
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -746,7 +794,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields != null);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -758,14 +806,14 @@
         assertTrue(mapValues.get(0).second == 2);
 
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
     
@@ -787,6 +835,30 @@
     }
     
     @Test
+    public void testQuerySplitWithSchema() {
+        planTester.buildPlan("a = load 'a' as (url, hitCount);");
+        LogicalPlan lp = planTester.buildPlan("split a into b if url == '3', c 
if hitCount == '3';");
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the split projection map has null mappedFields
+        LOSplit split = (LOSplit)lp.getSuccessors(load).get(0);
+        ProjectionMap splitProjectionMap = split.getProjectionMap();
+        assertTrue(splitProjectionMap.changes() == false);
+        
+        LOSplitOutput splitb = (LOSplitOutput)lp.getSuccessors(split).get(0);
+        ProjectionMap splitbProjectionMap = splitb.getProjectionMap();
+        assertTrue(splitbProjectionMap.changes() == false);
+        
+        LOSplitOutput splitc = (LOSplitOutput)lp.getSuccessors(split).get(1);
+        ProjectionMap splitcProjectionMap = splitc.getProjectionMap();
+        assertTrue(splitcProjectionMap.changes() == false);
+    }
+    
+    @Test
     public void testQueryOrderByWithSchema() {
         planTester.buildPlan("a = load 'a' as (url,hitCount);");
         LogicalPlan lp = planTester.buildPlan("b = order a by $1;");
@@ -804,6 +876,30 @@
     }
     
     @Test
+    public void testQueryLimitWithSchema() {
+        planTester.buildPlan("a = load 'a' as (url,hitCount);");
+        planTester.buildPlan("b = order a by $1;");
+        LogicalPlan lp = planTester.buildPlan("c = limit b 10;");
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the order by projection map is not null
+        LOSort sort = (LOSort)lp.getSuccessors(load).get(0);
+        ProjectionMap sortProjectionMap = sort.getProjectionMap();
+        assertTrue(sortProjectionMap != null);
+        assertTrue(sortProjectionMap.changes() == false);
+        
+        //check that the limit projection map is not null
+        LOLimit limit = (LOLimit)lp.getLeaves().get(0);
+        ProjectionMap limitProjectionMap = limit.getProjectionMap();
+        assertTrue(limitProjectionMap != null);
+        assertTrue(limitProjectionMap.changes() == false);
+    }
+    
+    @Test
     public void testQueryDistinctWithSchema() {
         planTester.buildPlan("a = load 'a' as (url,hitCount);");
         LogicalPlan lp = planTester.buildPlan("b = distinct a;");
@@ -820,6 +916,61 @@
         assertTrue(distinctProjectionMap.changes() == false);
     }
 
+    @Test
+    public void testQueryStreamingWithSchema() {
+        String query = "stream (load 'a') through `" + 
simpleEchoStreamingCommand + "` as (x, y);";
+        LogicalPlan lp = planTester.buildPlan(query);
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the stream projection map is null
+        LOStream stream = (LOStream)lp.getLeaves().get(0);
+        ProjectionMap streamProjectionMap = stream.getProjectionMap();
+        assertTrue(streamProjectionMap.changes() == true);
+        assertTrue(streamProjectionMap.getMappedFields() == null);
+        assertTrue(streamProjectionMap.getRemovedFields() == null);
+        
+        List<Integer> streamAddedFields = streamProjectionMap.getAddedFields();
+        assertTrue(streamAddedFields.size() == 2);
+        assertTrue(streamAddedFields.get(0) == 0);
+        assertTrue(streamAddedFields.get(1) == 1);
+    }
+
+    @Test
+    public void testQueryStreamingWithSchema1() {
+        String query = "stream (load 'a' as (url, hitCount)) through `" + 
simpleEchoStreamingCommand + "` as (x, y);";
+        LogicalPlan lp = planTester.buildPlan(query);
+        
+        //check that the load projection map is null
+        LOLoad load = (LOLoad) lp.getRoots().get(0);
+        ProjectionMap loadProjectionMap = load.getProjectionMap();
+        assertTrue(loadProjectionMap == null);
+        
+        //check that the stream projection map is null
+        LOStream stream = (LOStream)lp.getLeaves().get(0);
+        ProjectionMap streamProjectionMap = stream.getProjectionMap();
+        assertTrue(streamProjectionMap.changes() == true);
+        assertTrue(streamProjectionMap.getMappedFields() == null);
+        
+        //check that removed fields has all the columns from the input load
+        List<Pair<Integer, Integer>> streamRemovedFields = 
streamProjectionMap.getRemovedFields();
+        assertTrue(streamRemovedFields.size() == 2);
+        Pair<Integer, Integer> removedField = streamRemovedFields.get(0);
+        assertTrue(removedField.first == 0);
+        assertTrue(removedField.second == 0);
+        
+        removedField = streamRemovedFields.get(1);
+        assertTrue(removedField.first == 0);
+        assertTrue(removedField.second == 1);
+        
+        List<Integer> streamAddedFields = streamProjectionMap.getAddedFields();
+        assertTrue(streamAddedFields.size() == 2);
+        assertTrue(streamAddedFields.get(0) == 0);
+        assertTrue(streamAddedFields.get(1) == 1);
+    }
     
     @Test
     public void testQueryImplicitJoinWithSchema() {
@@ -842,7 +993,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> cogroupMapValues = 
(ArrayList<Pair<Integer, Integer>>)cogroupMapFields.get(0);
@@ -852,7 +1003,7 @@
         assertTrue(cogroupMapValues.get(1).second == 0);
         
         //check that removed fields has hitCount from a and rank from b
-        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFields();
         assertTrue(cogroupRemovedFields.size() == 2);
         Pair<Integer, Integer> removedField = cogroupRemovedFields.get(0);
         assertTrue(removedField.first == 0);
@@ -864,7 +1015,7 @@
 
         
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -874,7 +1025,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields();
         assertTrue(foreachMapFields != null);
         
         List<Pair<Integer, Integer>> foreachMapValues = 
(ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -898,11 +1049,11 @@
         assertTrue(foreachMapValues.get(0).second == 2);
         
         //check that removed fields is null
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields == null);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
         
         lp = planTester.buildPlan("e = foreach d generate group, a::url, 
b::url, b::rank, rank;");
@@ -911,7 +1062,7 @@
         foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        foreachMapFields = foreachProjectionMap.getMappedFileds();
+        foreachMapFields = foreachProjectionMap.getMappedFields();
         assertTrue(foreachMapFields != null);
         
         foreachMapValues = (ArrayList<Pair<Integer, 
Integer>>)foreachMapFields.get(0);
@@ -935,7 +1086,7 @@
         assertTrue(foreachMapValues.get(0).second == 4);
         
         //check that removed fields is null
-        foreachRemovedFields = foreachProjectionMap.getRemovedFileds();
+        foreachRemovedFields = foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields != null);
         assertTrue(foreachRemovedFields.size() == 1);
         
@@ -944,7 +1095,7 @@
         assertTrue(removedField.second == 2);
         
         //check that added fields is null
-        foreachAddedFields = foreachProjectionMap.getAddedFileds();
+        foreachAddedFields = foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
     
@@ -967,7 +1118,7 @@
         ProjectionMap crossProjectionMap = cross.getProjectionMap();
         assertTrue(crossProjectionMap != null);
         
-        MultiMap<Integer, Pair<Integer, Integer>> crossMapFields = 
crossProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> crossMapFields = 
crossProjectionMap.getMappedFields();
         assertTrue(crossMapFields != null);
         
         List<Pair<Integer, Integer>> crossMapValues = (ArrayList<Pair<Integer, 
Integer>>)crossMapFields.get(0);
@@ -987,11 +1138,11 @@
         assertTrue(crossMapValues.get(0).second == 1);
         
         //check that removed fields is null
-        List<Pair<Integer, Integer>> crossRemovedFields = 
crossProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> crossRemovedFields = 
crossProjectionMap.getRemovedFields();
         assertTrue(crossRemovedFields == null);
         
         //check that added fields is null
-        List<Integer> crossAddedFields = crossProjectionMap.getAddedFileds();
+        List<Integer> crossAddedFields = crossProjectionMap.getAddedFields();
         assertTrue(crossAddedFields == null);
     }
     
@@ -1014,7 +1165,7 @@
         ProjectionMap unionProjectionMap = union.getProjectionMap();
         assertTrue(unionProjectionMap != null);
         
-        MultiMap<Integer, Pair<Integer, Integer>> unionMapFields = 
unionProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> unionMapFields = 
unionProjectionMap.getMappedFields();
         assertTrue(unionMapFields != null);
 
         List<Pair<Integer, Integer>> unionMapValues = (ArrayList<Pair<Integer, 
Integer>>)unionMapFields.get(0);
@@ -1032,11 +1183,11 @@
         assertTrue(unionMapValues.get(1).second == 1);
         
         //check that removed fields is null
-        List<Pair<Integer, Integer>> unionRemovedFields = 
unionProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> unionRemovedFields = 
unionProjectionMap.getRemovedFields();
         assertTrue(unionRemovedFields == null);
         
         //check that added fields is null
-        List<Integer> unionAddedFields = unionProjectionMap.getAddedFileds();
+        List<Integer> unionAddedFields = unionProjectionMap.getAddedFields();
         assertTrue(unionAddedFields == null);
 
     }
@@ -1060,7 +1211,7 @@
         ProjectionMap frjoinProjectionMap = frjoin.getProjectionMap();
         assertTrue(frjoinProjectionMap != null);
         
-        MultiMap<Integer, Pair<Integer, Integer>> frjoinMapFields = 
frjoinProjectionMap.getMappedFileds();
+        MultiMap<Integer, Pair<Integer, Integer>> frjoinMapFields = 
frjoinProjectionMap.getMappedFields();
         assertTrue(frjoinMapFields != null);
 
         List<Pair<Integer, Integer>> frjoinMapValues = 
(ArrayList<Pair<Integer, Integer>>)frjoinMapFields.get(0);
@@ -1080,11 +1231,11 @@
         assertTrue(frjoinMapValues.get(0).second == 1);
         
         //check that removed fields is null
-        List<Pair<Integer, Integer>> frjoinRemovedFields = 
frjoinProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> frjoinRemovedFields = 
frjoinProjectionMap.getRemovedFields();
         assertTrue(frjoinRemovedFields == null);
         
         //check that added fields is null
-        List<Integer> frjoinAddedFields = frjoinProjectionMap.getAddedFileds();
+        List<Integer> frjoinAddedFields = frjoinProjectionMap.getAddedFields();
         assertTrue(frjoinAddedFields == null);
 
     }
@@ -1108,7 +1259,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -1118,7 +1269,7 @@
         assertTrue(mapValues.get(1).second == 0);
         
         //check that removed fields is not null
-        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFields();
         assertTrue(cogroupRemovedFields != null);
         
         Pair<Integer, Integer> removedFields = cogroupRemovedFields.get(0);
@@ -1130,7 +1281,7 @@
         assertTrue(removedFields.second == 1);
 
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -1140,7 +1291,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields != null);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -1161,14 +1312,14 @@
 
         
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
 
@@ -1252,7 +1403,7 @@
         ProjectionMap cogroupProjectionMap = cogroup.getProjectionMap();
         assertTrue(cogroupProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> cogroupMapFields = 
cogroupProjectionMap.getMappedFields(); 
         assertTrue(cogroupMapFields != null);
         
         List<Pair<Integer, Integer>> mapValues = (ArrayList<Pair<Integer, 
Integer>>)cogroupMapFields.get(0);
@@ -1262,7 +1413,7 @@
         assertTrue(mapValues.get(1).second == 0);
         
         //check that removed fields is not null
-        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> cogroupRemovedFields = 
cogroupProjectionMap.getRemovedFields();
         assertTrue(cogroupRemovedFields.size() == 1);
         
         Pair<Integer, Integer> removedFields = cogroupRemovedFields.get(0);
@@ -1270,7 +1421,7 @@
         assertTrue(removedFields.second == 1);
 
         //check that cogroup added fields contain [1, 2]
-        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFileds();
+        List<Integer> cogroupAddedFields = 
cogroupProjectionMap.getAddedFields();
         assertTrue(cogroupAddedFields.size() == 2);
         assertTrue(cogroupAddedFields.get(0) == 1);
         assertTrue(cogroupAddedFields.get(1) == 2);
@@ -1280,7 +1431,7 @@
         ProjectionMap foreachProjectionMap = foreach.getProjectionMap();
         assertTrue(foreachProjectionMap.changes() == true);
         
-        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFileds(); 
+        MultiMap<Integer, Pair<Integer, Integer>> foreachMapFields = 
foreachProjectionMap.getMappedFields(); 
         assertTrue(foreachMapFields.size() == 3);
         
         mapValues = (ArrayList<Pair<Integer, Integer>>)foreachMapFields.get(0);
@@ -1297,14 +1448,14 @@
 
         
         //check that removed fields has all the group column from the input 
cogroup
-        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFileds();
+        List<Pair<Integer, Integer>> foreachRemovedFields = 
foreachProjectionMap.getRemovedFields();
         assertTrue(foreachRemovedFields.size() == 1);
         Pair<Integer, Integer> removedField = foreachRemovedFields.get(0);
         assertTrue(removedField.first == 0);
         assertTrue(removedField.second == 0);
         
         //check that added fields is null
-        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFileds();
+        List<Integer> foreachAddedFields = 
foreachProjectionMap.getAddedFields();
         assertTrue(foreachAddedFields == null);
     }
     


Reply via email to