Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/TestPOUserFunc.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestPOUserFunc.java?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestPOUserFunc.java 
(original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestPOUserFunc.java 
Thu May 15 18:09:30 2008
@@ -40,293 +40,293 @@
 import org.apache.pig.impl.physicalLayer.POStatus;
 import org.apache.pig.impl.physicalLayer.Result;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.PORead;
-import 
org.apache.pig.impl.physicalLayer.topLevelOperators.POUserComparisonFunc;
-import org.apache.pig.impl.physicalLayer.topLevelOperators.POUserFunc;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.PhysicalOperator;
+import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.POUserComparisonFunc;
+import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.POUserFunc;
 import org.apache.pig.test.utils.GenRandomData;
 import org.junit.Test;
 
 public class TestPOUserFunc extends TestCase {
-    Random r = new Random();
-    int MAX_TUPLES = 10;
+       Random r = new Random();
+       int MAX_TUPLES = 10;
 
-    public static class ARITY extends EvalFunc<Integer> {
+       public static class ARITY extends EvalFunc<Integer> {
 
-        @Override
-        public Integer exec(Tuple input) throws IOException {
-            return new Integer(input.size());
-        }
-
-        @Override
-        public Schema outputSchema(Schema input) {
-            // TODO FIX
-            // return new AtomSchema("arity");
-            return null;
-        }
-    }
-
-    public static class WeirdComparator extends ComparisonFunc {
-
-        @Override
-        public int compare(Tuple t1, Tuple t2) {
-            // TODO Auto-generated method stub
-            Object o1 = null;
-            Object o2 = null;
-            try {
-                o1 = t1.get(2);
-                o2 = t2.get(2);
-            } catch (ExecException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-            int i1 = (Integer) o1 - 2;
-            int i2 = (Integer) o2 - 2;
-
-            return (int) (i1 * i1 - i2 * i2);
-        }
-
-    }
-
-    /**
-     * Generates the average of the values of the first field of a tuple. This
-     * class is Algebraic in implemenation, so if possible the execution will 
be
-     * split into a local and global application
-     */
-    public static class AVG extends EvalFunc<Double> implements Algebraic {
-
-        private static TupleFactory mTupleFactory = TupleFactory.getInstance();
-
-        @Override
-        public Double exec(Tuple input) throws IOException {
-            double sum = 0;
-            double count = 0;
-            
-            try {
-                sum = sum(input);
-                count = count(input);
-            } catch (ExecException e) {
-                e.printStackTrace();
-            }
-
-            double avg = 0;
-            if (count > 0)
-                avg = sum / count;
-
-            return new Double(avg);
-        }
-
-        public String getInitial() {
-            return Initial.class.getName();
-        }
-
-        public String getIntermed() {
-            return Intermed.class.getName();
-        }
-
-        public String getFinal() {
-            return Final.class.getName();
-        }
-
-        static public class Initial extends EvalFunc<Tuple> {
-            @Override
-            public Tuple exec(Tuple input) throws IOException {
-                try {
-                    Tuple t = mTupleFactory.newTuple(2);
-                    t.set(0, new Double(sum(input)));
-                    t.set(1, new Long(count(input)));
-                    return t;
-                } catch (ExecException t) {
-                    throw new RuntimeException(t.getMessage() + ": " + input);
-                }
-            }
-        }
-
-        static public class Intermed extends EvalFunc<Tuple> {
-            @Override
-            public Tuple exec(Tuple input) throws IOException {
-                DataBag b = null;
-                Tuple t = null;
-                try {
-                    b = (DataBag) input.get(0);
-                    t = combine(b);
-                } catch (ExecException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                }
-                return t;
-            }
-        }
-
-        static public class Final extends EvalFunc<Double> {
-            @Override
-            public Double exec(Tuple input) throws IOException {
-                double sum = 0;
-                double count = 0;
-                try {
-                    DataBag b = (DataBag) input.get(0);
-                    Tuple combined = combine(b);
-
-                    sum = (Double) combined.get(0);
-                    count = (Long) combined.get(1);
-                } catch (ExecException e) {
-                    e.printStackTrace();
-                }
-
-                double avg = 0;
-                if (count > 0) {
-                    avg = sum / count;
-                }
-                return new Double(avg);
-            }
-        }
-
-        static protected Tuple combine(DataBag values) throws ExecException {
-            double sum = 0;
-            long count = 0;
-
-            Tuple output = mTupleFactory.newTuple(2);
-
-            for (Iterator<Tuple> it = values.iterator(); it.hasNext();) {
-                Tuple t = it.next();
-                sum += (Double) t.get(0);
-                count += (Long) t.get(1);
-            }
-
-            output.set(0, new Double(sum));
-            output.set(1, new Long(count));
-            return output;
-        }
-
-        static protected long count(Tuple input) throws ExecException {
-            DataBag values = (DataBag) input.get(0);
-            return values.size();
-        }
-
-        static protected double sum(Tuple input) throws ExecException {
-            DataBag values = (DataBag) input.get(0);
-
-            double sum = 0;
-            for (Iterator<Tuple> it = values.iterator(); it.hasNext();) {
-                Tuple t = it.next();
-                Double d = DataType.toDouble(t.get(0));
-                if (d == null)
-                    continue;
-                sum += d;
-            }
-
-            return sum;
-        }
-
-        @Override
-        public Schema outputSchema(Schema input) {
-            // TODO FIX
-            // return new AtomSchema("average");
-            return null;
-        }
-
-    }
-
-    @Test
-    public void testUserFuncArity() throws ExecException {
-        DataBag input = (DataBag) GenRandomData.genRandSmallTupDataBag(r,
-                MAX_TUPLES, 100);
-        String funcSpec = ARITY.class.getName() + "()";
-        PORead read = new PORead(new OperatorKey("", r.nextLong()), input);
-        List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
-        inputs.add(read);
-        POUserFunc userFunc = new POUserFunc(new OperatorKey("", r.nextLong()),
-                -1, inputs, funcSpec);
-        Result res = new Result();
-        Integer i = null;
-        res = userFunc.getNext(i);
-        while (res.returnStatus != POStatus.STATUS_EOP) {
-            // System.out.println(res.result);
-            int result = (Integer) res.result;
-            assertEquals(2, result);
-            res = userFunc.getNext(i);
-        }
-    }
-
-    @Test
-    public void testUDFCompare() throws ExecException {
-        DataBag input = (DataBag) GenRandomData.genRandSmallTupDataBag(r, 2,
-                100);
-        String funcSpec = WeirdComparator.class.getName() + "()";
-        POUserFunc userFunc = new POUserComparisonFunc(new OperatorKey("", 
r.nextLong()),
-                -1, null, funcSpec);
-        Iterator<Tuple> it = input.iterator();
-        Tuple t1 = it.next();
-        Tuple t2 = it.next();
-        t1.append(2);
-        t2.append(3);
-        ((POUserComparisonFunc)userFunc).attachInput(t1, t2);
-        Integer i = null;
-        // System.out.println(t1 + " " + t2);
-        int result = (Integer) (userFunc.getNext(i).result);
-        assertEquals(-1, result);
-    }
-
-    @Test
-    public void testAlgebraicAVG() throws IOException, ExecException {
-        int input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
-        byte INIT = 0;
-        byte INTERMED = 1;
-        byte FINAL = 2;
-        Tuple tup1 = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1),
-                input);
-        Tuple tup2 = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1),
-                input);
-        // System.out.println("Input = " + tup1);
-        String funcSpec = AVG.class.getName() + "()";
-
-        POUserFunc po = new POUserFunc(new OperatorKey("", r.nextLong()), -1,
-                null, funcSpec);
-
-        TupleFactory tf = TupleFactory.getInstance();
-
-        po.setAlgebraicFunction(INIT);
-        po.attachInput(tup1);
-        Tuple t = null;
-        Result res = po.getNext(t);
-        Tuple outputInitial1 = (res.returnStatus == POStatus.STATUS_OK) ? 
(Tuple) res.result
-                : null;
-        Tuple outputInitial2 = (res.returnStatus == POStatus.STATUS_OK) ? 
(Tuple) res.result
-                : null;
-        System.out.println(outputInitial1 + " " + outputInitial2);
-        assertEquals(outputInitial1, outputInitial2);
-        double sum = (Double) outputInitial1.get(0);
-        long count = (Long) outputInitial1.get(1);
-        assertEquals(55.0, sum);
-        assertEquals(10, count);
-        DataBag bag = BagFactory.getInstance().newDefaultBag();
-        bag.add(outputInitial1);
-        bag.add(outputInitial2);
-        Tuple outputInitial = tf.newTuple();
-        outputInitial.append(bag);
-        // Tuple outputIntermed = intermed.exec(outputInitial);
-        po = new POUserFunc(new OperatorKey("", r.nextLong()), -1, null,
-                funcSpec);
-        po.setAlgebraicFunction(INTERMED);
-        po.attachInput(outputInitial);
-        res = po.getNext(t);
-        Tuple outputIntermed = (res.returnStatus == POStatus.STATUS_OK) ? 
(Tuple) res.result
-                : null;
-
-        sum = (Double) outputIntermed.get(0);
-        count = (Long) outputIntermed.get(1);
-        assertEquals(110.0, sum);
-        assertEquals(20, count);
-        System.out.println(outputIntermed);
-        po = new POUserFunc(new OperatorKey("", r.nextLong()), -1, null,
-                funcSpec);
-        po.setAlgebraicFunction(FINAL);
-        po.attachInput(outputInitial);
-        res = po.getNext(t);
-        Double output = (res.returnStatus == POStatus.STATUS_OK) ? (Double) 
res.result
-                : null;
-        // Double output = fin.exec(outputInitial);
-        assertEquals(5.5, output);
-        // System.out.println("output = " + output);
+               @Override
+               public Integer exec(Tuple input) throws IOException {
+                       return new Integer(input.size());
+               }
+
+               @Override
+               public Schema outputSchema(Schema input) {
+                       // TODO FIX
+                       // return new AtomSchema("arity");
+                       return null;
+               }
+       }
+
+       public static class WeirdComparator extends ComparisonFunc {
+
+               @Override
+               public int compare(Tuple t1, Tuple t2) {
+                       // TODO Auto-generated method stub
+                       Object o1 = null;
+                       Object o2 = null;
+                       try {
+                               o1 = t1.get(2);
+                               o2 = t2.get(2);
+                       } catch (ExecException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+                       int i1 = (Integer) o1 - 2;
+                       int i2 = (Integer) o2 - 2;
+
+                       return (int) (i1 * i1 - i2 * i2);
+               }
+
+       }
+
+       /**
+        * Generates the average of the values of the first field of a tuple. 
This
+        * class is Algebraic in implemenation, so if possible the execution 
will be
+        * split into a local and global application
+        */
+       public static class AVG extends EvalFunc<Double> implements Algebraic {
+
+               private static TupleFactory mTupleFactory = 
TupleFactory.getInstance();
+
+               @Override
+               public Double exec(Tuple input) throws IOException {
+                       double sum = 0;
+                       double count = 0;
+                       
+                       try {
+                               sum = sum(input);
+                               count = count(input);
+                       } catch (ExecException e) {
+                               e.printStackTrace();
+                       }
+
+                       double avg = 0;
+                       if (count > 0)
+                               avg = sum / count;
+
+                       return new Double(avg);
+               }
+
+               public String getInitial() {
+                       return Initial.class.getName();
+               }
+
+               public String getIntermed() {
+                       return Intermed.class.getName();
+               }
+
+               public String getFinal() {
+                       return Final.class.getName();
+               }
+
+               static public class Initial extends EvalFunc<Tuple> {
+                       @Override
+                       public Tuple exec(Tuple input) throws IOException {
+                               try {
+                                       Tuple t = mTupleFactory.newTuple(2);
+                                       t.set(0, new Double(sum(input)));
+                                       t.set(1, new Long(count(input)));
+                                       return t;
+                               } catch (ExecException t) {
+                                       throw new 
RuntimeException(t.getMessage() + ": " + input);
+                               }
+                       }
+               }
+
+               static public class Intermed extends EvalFunc<Tuple> {
+                       @Override
+                       public Tuple exec(Tuple input) throws IOException {
+                               DataBag b = null;
+                               Tuple t = null;
+                               try {
+                                       b = (DataBag) input.get(0);
+                                       t = combine(b);
+                               } catch (ExecException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
+                               return t;
+                       }
+               }
+
+               static public class Final extends EvalFunc<Double> {
+                       @Override
+                       public Double exec(Tuple input) throws IOException {
+                               double sum = 0;
+                               double count = 0;
+                               try {
+                                       DataBag b = (DataBag) input.get(0);
+                                       Tuple combined = combine(b);
+
+                                       sum = (Double) combined.get(0);
+                                       count = (Long) combined.get(1);
+                               } catch (ExecException e) {
+                                       e.printStackTrace();
+                               }
+
+                               double avg = 0;
+                               if (count > 0) {
+                                       avg = sum / count;
+                               }
+                               return new Double(avg);
+                       }
+               }
+
+               static protected Tuple combine(DataBag values) throws 
ExecException {
+                       double sum = 0;
+                       long count = 0;
+
+                       Tuple output = mTupleFactory.newTuple(2);
+
+                       for (Iterator<Tuple> it = values.iterator(); 
it.hasNext();) {
+                               Tuple t = it.next();
+                               sum += (Double) t.get(0);
+                               count += (Long) t.get(1);
+                       }
+
+                       output.set(0, new Double(sum));
+                       output.set(1, new Long(count));
+                       return output;
+               }
+
+               static protected long count(Tuple input) throws ExecException {
+                       DataBag values = (DataBag) input.get(0);
+                       return values.size();
+               }
+
+               static protected double sum(Tuple input) throws ExecException {
+                       DataBag values = (DataBag) input.get(0);
+
+                       double sum = 0;
+                       for (Iterator<Tuple> it = values.iterator(); 
it.hasNext();) {
+                               Tuple t = it.next();
+                               Double d = DataType.toDouble(t.get(0));
+                               if (d == null)
+                                       continue;
+                               sum += d;
+                       }
+
+                       return sum;
+               }
+
+               @Override
+               public Schema outputSchema(Schema input) {
+                       // TODO FIX
+                       // return new AtomSchema("average");
+                       return null;
+               }
+
+       }
+
+       @Test
+       public void testUserFuncArity() throws ExecException {
+               DataBag input = (DataBag) 
GenRandomData.genRandSmallTupDataBag(r,
+                               MAX_TUPLES, 100);
+               String funcSpec = ARITY.class.getName() + "()";
+               PORead read = new PORead(new OperatorKey("", r.nextLong()), 
input);
+               List<PhysicalOperator> inputs = new 
LinkedList<PhysicalOperator>();
+               inputs.add(read);
+               POUserFunc userFunc = new POUserFunc(new OperatorKey("", 
r.nextLong()),
+                               -1, inputs, funcSpec);
+               Result res = new Result();
+               Integer i = null;
+               res = userFunc.getNext(i);
+               while (res.returnStatus != POStatus.STATUS_EOP) {
+                       // System.out.println(res.result);
+                       int result = (Integer) res.result;
+                       assertEquals(2, result);
+                       res = userFunc.getNext(i);
+               }
+       }
+
+       @Test
+       public void testUDFCompare() throws ExecException {
+               DataBag input = (DataBag) 
GenRandomData.genRandSmallTupDataBag(r, 2,
+                               100);
+               String funcSpec = WeirdComparator.class.getName() + "()";
+               POUserFunc userFunc = new POUserComparisonFunc(new 
OperatorKey("", r.nextLong()),
+                               -1, null, funcSpec);
+               Iterator<Tuple> it = input.iterator();
+               Tuple t1 = it.next();
+               Tuple t2 = it.next();
+               t1.append(2);
+               t2.append(3);
+               ((POUserComparisonFunc)userFunc).attachInput(t1, t2);
+               Integer i = null;
+               // System.out.println(t1 + " " + t2);
+               int result = (Integer) (userFunc.getNext(i).result);
+               assertEquals(-1, result);
+       }
+
+       @Test
+       public void testAlgebraicAVG() throws IOException, ExecException {
+               int input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+               byte INIT = 0;
+               byte INTERMED = 1;
+               byte FINAL = 2;
+               Tuple tup1 = 
Util.loadNestTuple(TupleFactory.getInstance().newTuple(1),
+                               input);
+               Tuple tup2 = 
Util.loadNestTuple(TupleFactory.getInstance().newTuple(1),
+                               input);
+               // System.out.println("Input = " + tup1);
+               String funcSpec = AVG.class.getName() + "()";
+
+               POUserFunc po = new POUserFunc(new OperatorKey("", 
r.nextLong()), -1,
+                               null, funcSpec);
+
+               TupleFactory tf = TupleFactory.getInstance();
+
+               po.setAlgebraicFunction(INIT);
+               po.attachInput(tup1);
+               Tuple t = null;
+               Result res = po.getNext(t);
+               Tuple outputInitial1 = (res.returnStatus == POStatus.STATUS_OK) 
? (Tuple) res.result
+                               : null;
+               Tuple outputInitial2 = (res.returnStatus == POStatus.STATUS_OK) 
? (Tuple) res.result
+                               : null;
+               System.out.println(outputInitial1 + " " + outputInitial2);
+               assertEquals(outputInitial1, outputInitial2);
+               double sum = (Double) outputInitial1.get(0);
+               long count = (Long) outputInitial1.get(1);
+               assertEquals(55.0, sum);
+               assertEquals(10, count);
+               DataBag bag = BagFactory.getInstance().newDefaultBag();
+               bag.add(outputInitial1);
+               bag.add(outputInitial2);
+               Tuple outputInitial = tf.newTuple();
+               outputInitial.append(bag);
+               // Tuple outputIntermed = intermed.exec(outputInitial);
+               po = new POUserFunc(new OperatorKey("", r.nextLong()), -1, null,
+                               funcSpec);
+               po.setAlgebraicFunction(INTERMED);
+               po.attachInput(outputInitial);
+               res = po.getNext(t);
+               Tuple outputIntermed = (res.returnStatus == POStatus.STATUS_OK) 
? (Tuple) res.result
+                               : null;
+
+               sum = (Double) outputIntermed.get(0);
+               count = (Long) outputIntermed.get(1);
+               assertEquals(110.0, sum);
+               assertEquals(20, count);
+               System.out.println(outputIntermed);
+               po = new POUserFunc(new OperatorKey("", r.nextLong()), -1, null,
+                               funcSpec);
+               po.setAlgebraicFunction(FINAL);
+               po.attachInput(outputInitial);
+               res = po.getNext(t);
+               Double output = (res.returnStatus == POStatus.STATUS_OK) ? 
(Double) res.result
+                               : null;
+               // Double output = fin.exec(outputInitial);
+               assertEquals(5.5, output);
+               // System.out.println("output = " + output);
 
-    }
+       }
 }

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC1.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC1.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC1.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC1.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-3:
+MapReduce(-1) - MRCompiler-3:
 |   Store(DummyFil:DummyLdr) - -6748240903696823165
 |   |
 |   |---Filter - -7469509242284658386
@@ -6,7 +6,7 @@
 |       |---Package - --7212359720440714287
 |   Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-2
 |
-|---MapReduce - MRCompiler-0:
+|---MapReduce(-1) - MRCompiler-0:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-1
     |   |
     |   |---Local Rearrange - -8345455294066939854

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC10.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC10.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC10.gld
 (original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC10.gld
 Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-68:
+MapReduce(-1) - MRCompiler-68:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - --2325244147060806375
 |   |
@@ -8,7 +8,7 @@
 |       |
 |       
|---Load(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) 
- MRCompiler-71
 |
-|---MapReduce - MRCompiler-60:
+|---MapReduce(-1) - MRCompiler-60:
 |   |   
Store(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-70
 |   |   |
 |   |   |---Package - --6957591191795645940
@@ -16,7 +16,7 @@
 |   |   
 |   |   
Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-63
 |   |
-|   |---MapReduce - MRCompiler-58:
+|   |---MapReduce(20) - MRCompiler-58:
 |   |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-62
 |   |   |   |
 |   |   |   |---Local Rearrange - --5190071275724378681
@@ -28,7 +28,7 @@
 |   |   |       |
 |   |   |       |---Load(DummyFil:DummyLdr) - --8361563503038121624
 |   |
-|   |---MapReduce - MRCompiler-59:
+|   |---MapReduce(30) - MRCompiler-59:
 |       |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-64
 |       |   |
 |       |   |---Local Rearrange - -580704905698185869
@@ -38,7 +38,7 @@
 |       |   |
 |       |   |---Load(DummyFil:DummyLdr) - -5515425171581967372
 |
-|---MapReduce - MRCompiler-67:
+|---MapReduce(-1) - MRCompiler-67:
     |   
Store(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) - 
MRCompiler-72
     |   |
     |   |---Filter - --1194577301115518934

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC11.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC11.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC11.gld
 (original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC11.gld
 Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-81:
+MapReduce(-1) - MRCompiler-81:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -7219092146411102494
 |   |
@@ -8,7 +8,7 @@
 |       |
 |       
|---Load(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-84
 |
-|---MapReduce - MRCompiler-75:
+|---MapReduce(-1) - MRCompiler-75:
 |   |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-83
 |   |   |
 |   |   |---Package - --2530083186736419352
@@ -22,7 +22,7 @@
 |   |   |
 |   |   
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) 
- MRCompiler-76
 |   |
-|   |---MapReduce - MRCompiler-73:
+|   |---MapReduce(-1) - MRCompiler-73:
 |       |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-77
 |       |   |
 |       |   |---Package - --4776862487779398064
@@ -30,7 +30,7 @@
 |       |   |
 |       |   |---Load(DummyFil:DummyLdr) - -3719468117239527682
 |
-|---MapReduce - MRCompiler-80:
+|---MapReduce(-1) - MRCompiler-80:
     |   
Store(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-85
     |   |
     |   |---Filter - -7127277012934370361

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC12.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC12.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC12.gld
 (original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC12.gld
 Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-92:
+MapReduce(-1) - MRCompiler-92:
 |   Store(DummyFil:DummyLdr) - -913122466036599874
 |   |
 |   |---Package - -8515950928528386562
@@ -16,7 +16,7 @@
 |           |
 |           
|---Load(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) 
- MRCompiler-90
 |
-|---MapReduce - MRCompiler-86:
+|---MapReduce(-1) - MRCompiler-86:
     Reduce Plan Empty
     |   
Store(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) - 
MRCompiler-87
     |   |

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC13.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC13.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC13.gld
 (original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC13.gld
 Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-105:
+MapReduce(-1) - MRCompiler-105:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -3777104251028634198
 |   |
@@ -12,7 +12,7 @@
 |           |
 |           
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-103
 |
-|---MapReduce - MRCompiler-99:
+|---MapReduce(-1) - MRCompiler-99:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-100
     |   |
     |   |---Package - --1195368474144577564
@@ -30,7 +30,7 @@
     |           |
     |           
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) 
- MRCompiler-97
     |
-    |---MapReduce - MRCompiler-93:
+    |---MapReduce(-1) - MRCompiler-93:
         Reduce Plan Empty
         |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-94
         |   |

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC14.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC14.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC14.gld
 (original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC14.gld
 Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-126:
+MapReduce(100) - MRCompiler-126:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - --7335024873119453444
 |   |
@@ -12,7 +12,7 @@
 |           |
 |           
|---Load(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) 
- MRCompiler-124
 |
-|---MapReduce - MRCompiler-120:
+|---MapReduce(40) - MRCompiler-120:
     |   
Store(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) - 
MRCompiler-121
     |   |
     |   |---Package - --1848504978980807369
@@ -36,7 +36,7 @@
     |           |
     |           
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-118
     |
-    |---MapReduce - MRCompiler-109:
+    |---MapReduce(20) - MRCompiler-109:
     |   Reduce Plan Empty
     |   |   
Store(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-110
     |   |   |
@@ -44,13 +44,13 @@
     |   |       |
     |   |       
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) 
- MRCompiler-108
     |   |
-    |   |---MapReduce - MRCompiler-106:
+    |   |---MapReduce(-1) - MRCompiler-106:
     |       Reduce Plan Empty
     |       |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-107
     |       |   |
     |       |   |---Load(DummyFil:DummyLdr) - -7955165653808522445
     |
-    |---MapReduce - MRCompiler-116:
+    |---MapReduce(10) - MRCompiler-116:
         Reduce Plan Empty
         |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-117
         |   |
@@ -58,7 +58,7 @@
         |       |
         |       
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) 
- MRCompiler-115
         |
-        |---MapReduce - MRCompiler-106:
+        |---MapReduce(-1) - MRCompiler-106:
             Reduce Plan Empty
             |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-107
             |   |

Added: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC15.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC15.gld?rev=656913&view=auto
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC15.gld
 (added)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC15.gld
 Thu May 15 18:09:30 2008
@@ -0,0 +1,105 @@
+MapReduce(-1,GFCross) - MRCompiler-161:
+|   Store(DummyFil:DummyLdr) - -5165956429696944631
+|   |
+|   |---For Each - -2197807331204639125
+|       |   |
+|       |   POGenerate(false)  - --8447156979210379761
+|       |   |   |
+|       |   |   POUserFunc(org.apache.pig.impl.builtin.GFCross) - 
-6139496040975471496
+|       |   |   |
+|       |   |   |---Project(*) - -5878058249424113280
+|       |
+|       |---Package - -7085374960058856883
+|   Load(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) 
- MRCompiler-160
+|
+|---MapReduce(-1,AVG) - MRCompiler-158:
+    |   
Store(/tmp/temp-1456742965/tmp-586682361:org.apache.pig.builtin.BinStorage) - 
MRCompiler-159
+    |   |
+    |   |---Local Rearrange - -7398260302074824818
+    |       |
+    |       |---For Each - -4188863770717253580
+    |           |   |
+    |           |   POGenerate(false)  - -7973970339130605847
+    |           |   |   |
+    |           |   |   POUserFunc(org.apache.pig.builtin.AVG) - 
--6860857982727545176
+    |           |   |   |
+    |           |   |   |---Project(*) - -2082992246427879202
+    |           |
+    |           |---Package - -737965411848544085
+    |   
Load(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-157
+    |
+    |---MapReduce(20,FindQuantiles,SUM) - MRCompiler-149:
+        |   
Store(/tmp/temp-1456742965/tmp-26634357:org.apache.pig.builtin.BinStorage) - 
MRCompiler-156
+        |   |
+        |   |---Local Rearrange - --3359714221559579809
+        |       |
+        |       |---For Each - --7926255547935388282
+        |           |   |
+        |           |   POGenerate(false,false)  - -8639002377389679348
+        |           |   |   |
+        |           |   |   
POUserFunc(org.apache.pig.impl.builtin.FindQuantiles) - -727770031531364881
+        |           |   |   |
+        |           |   |   |---Project(*) - -7128285064986147947
+        |           |   |   |
+        |           |   |   POUserFunc(org.apache.pig.builtin.SUM) - 
--5683415113785058706
+        |           |   |   |
+        |           |   |   |---Project(*) - --8002381389674382470
+        |           |
+        |           |---For Each - MRCompiler-155
+        |               |   |
+        |               |   POGenerate(true)  - MRCompiler-154
+        |               |   |   |
+        |               |   |   Project(1) - MRCompiler-153
+        |               |
+        |               |---Package - MRCompiler-152
+        |   Local Rearrange - MRCompiler-151
+        |   |   |
+        |   |   Project(0) - MRCompiler-150
+        |   |
+        |   
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) 
- MRCompiler-148
+        |
+        |---MapReduce(-1,FindQuantiles,TestMRCompiler$WeirdComparator) - 
MRCompiler-130:
+            |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-147
+            |   |
+            |   |---For Each - MRCompiler-146
+            |       |   |
+            |       |   POGenerate(false)  - MRCompiler-145
+            |       |   |   |
+            |       |   |   
POUserFunc(org.apache.pig.impl.builtin.FindQuantiles) - MRCompiler-144
+            |       |   |   |
+            |       |   |   |---Project(*) - MRCompiler-143
+            |       |
+            |       |---For Each - MRCompiler-142
+            |           |   |
+            |           |   POGenerate(false,false)  - MRCompiler-141
+            |           |   |   |
+            |           |   |   Constant(20) - MRCompiler-140
+            |           |   |   |
+            |           |   |   Project(*) - MRCompiler-139
+            |           |   |
+            |           |   |---POSort - --776319888013965510
+            |           |       |   |
+            |           |       |   Project(*) - MRCompiler-138
+            |           |       |
+            |           |       |---Project(1) - MRCompiler-137
+            |           |
+            |           |---Package - MRCompiler-136
+            |   Local Rearrange - MRCompiler-135
+            |   |   |
+            |   |   Constant(all) - MRCompiler-134
+            |   |
+            |   |---For Each - MRCompiler-133
+            |       |   |
+            |       |   POGenerate(true)  - MRCompiler-132
+            |       |   |   |
+            |       |   |   Project(0) - MRCompiler-131
+            |       |
+            |       
|---Load(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.impl.builtin.RandomSampleLoader)
 - MRCompiler-129
+            |
+            |---MapReduce(-1) - MRCompiler-127:
+                Reduce Plan Empty
+                |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-128
+                |   |
+                |   |---Filter - --4867358672373443663
+                |       |
+                |       |---Load(DummyFil:DummyLdr) - -31712229583931650
\ No newline at end of file

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC2.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC2.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC2.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC2.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-6:
+MapReduce(-1) - MRCompiler-6:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -8637487025682524492
 |   |
@@ -8,7 +8,7 @@
 |       |
 |       
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-9
 |
-|---MapReduce - MRCompiler-4:
+|---MapReduce(-1) - MRCompiler-4:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-8
 |   |   |
 |   |   |---Package - --8216215966586363937
@@ -16,7 +16,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - -990040854696137546
 |
-|---MapReduce - MRCompiler-5:
+|---MapReduce(-1) - MRCompiler-5:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-10
     |   |
     |   |---Package - -7473175511145418837

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC3.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC3.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC3.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC3.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-14:
+MapReduce(-1) - MRCompiler-14:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -5879589559059467399
 |   |
@@ -12,7 +12,7 @@
 |       |
 |       
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-17
 |
-|---MapReduce - MRCompiler-11:
+|---MapReduce(-1) - MRCompiler-11:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-16
 |   |   |
 |   |   |---Package - --2449990780759860228
@@ -20,7 +20,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - -3527883492192621891
 |
-|---MapReduce - MRCompiler-12:
+|---MapReduce(-1) - MRCompiler-12:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-18
     |   |
     |   |---Package - --961974426096759446

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC4.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC4.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC4.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC4.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-23:
+MapReduce(-1) - MRCompiler-23:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -956528893337238225
 |   |
@@ -16,7 +16,7 @@
 |       |
 |       
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-26
 |
-|---MapReduce - MRCompiler-19:
+|---MapReduce(-1) - MRCompiler-19:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-25
 |   |   |
 |   |   |---Package - --4083686173685839766
@@ -24,7 +24,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - -3742910951635599848
 |
-|---MapReduce - MRCompiler-21:
+|---MapReduce(-1) - MRCompiler-21:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-27
     |   |
     |   |---Package - -3943647700946858188

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC5.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC5.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC5.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC5.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-30:
+MapReduce(-1) - MRCompiler-30:
 Reduce Plan Empty
 |   Store(DummyFil:DummyLdr) - -340188275237520979
 |   |

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC6.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC6.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC6.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC6.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-33:
+MapReduce(-1) - MRCompiler-33:
 |   Store(DummyFil:DummyLdr) - -8531323295221133204
 |   |
 |   |---Package - -3515731110955624708
@@ -6,7 +6,7 @@
 |   
 |   Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-36
 |
-|---MapReduce - MRCompiler-31:
+|---MapReduce(-1) - MRCompiler-31:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-35
 |   |   |
 |   |   |---Local Rearrange - --7797378030368227515
@@ -16,7 +16,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - --5941754500044119766
 |
-|---MapReduce - MRCompiler-32:
+|---MapReduce(-1) - MRCompiler-32:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-37
     |   |
     |   |---Local Rearrange - -6869916393445222618

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC7.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC7.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC7.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC7.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-41:
+MapReduce(-1) - MRCompiler-41:
 |   Store(DummyFil:DummyLdr) - -8205341881606740757
 |   |
 |   |---Package - -8067897495211048679
@@ -12,7 +12,7 @@
 |   |
 |   
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-44
 |
-|---MapReduce - MRCompiler-38:
+|---MapReduce(-1) - MRCompiler-38:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-43
 |   |   |
 |   |   |---Local Rearrange - --8754957318949788629
@@ -22,7 +22,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - --1607475648664293401
 |
-|---MapReduce - MRCompiler-39:
+|---MapReduce(-1) - MRCompiler-39:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-45
     |   |
     |   |---Local Rearrange - -2056844330428347996

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC8.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC8.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC8.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC8.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-50:
+MapReduce(-1) - MRCompiler-50:
 |   Store(DummyFil:DummyLdr) - -370083002387034672
 |   |
 |   |---Package - --7096529877081178520
@@ -16,7 +16,7 @@
 |   |
 |   
|---Load(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) 
- MRCompiler-53
 |
-|---MapReduce - MRCompiler-48:
+|---MapReduce(-1) - MRCompiler-48:
 |   |   
Store(/tmp/temp-1456742965/tmp-1456742965:org.apache.pig.builtin.BinStorage) - 
MRCompiler-52
 |   |   |
 |   |   |---Local Rearrange - -6790164331631653200
@@ -26,7 +26,7 @@
 |   |   |
 |   |   |---Load(DummyFil:DummyLdr) - -6620645493024302760
 |
-|---MapReduce - MRCompiler-49:
+|---MapReduce(-1) - MRCompiler-49:
     |   
Store(/tmp/temp-1456742965/tmp2077335416:org.apache.pig.builtin.BinStorage) - 
MRCompiler-54
     |   |
     |   |---Local Rearrange - -8729990799028586395

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC9.gld
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC9.gld?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC9.gld 
(original)
+++ 
incubator/pig/branches/types/test/org/apache/pig/test/data/GoldenFiles/MRC9.gld 
Thu May 15 18:09:30 2008
@@ -1,4 +1,4 @@
-MapReduce - MRCompiler-57:
+MapReduce(-1) - MRCompiler-57:
 |   Store(DummyFil:DummyLdr) - -7506868571066332964
 |   |
 |   |---Package - -7034055442337723447

Modified: 
incubator/pig/branches/types/test/org/apache/pig/test/utils/GenPhyOp.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/utils/GenPhyOp.java?rev=656913&r1=656912&r2=656913&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/utils/GenPhyOp.java 
(original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/utils/GenPhyOp.java 
Thu May 15 18:09:30 2008
@@ -18,6 +18,7 @@
 package org.apache.pig.test.utils;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
@@ -27,6 +28,7 @@
 import org.apache.pig.data.DataType;
 import org.apache.pig.data.Tuple;
 import org.apache.pig.impl.PigContext;
+import org.apache.pig.impl.builtin.FindQuantiles;
 import org.apache.pig.impl.io.FileLocalizer;
 import org.apache.pig.impl.io.FileSpec;
 import org.apache.pig.impl.logicalLayer.OperatorKey;
@@ -39,6 +41,7 @@
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POGlobalRearrange;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POLoad;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POLocalRearrange;
+import org.apache.pig.impl.physicalLayer.topLevelOperators.POLocalRearrange;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POPackage;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POSplit;
 import org.apache.pig.impl.physicalLayer.topLevelOperators.POStore;
@@ -47,6 +50,7 @@
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.ConstantExpression;
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.POCast;
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.POProject;
+import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.POUserFunc;
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.binaryExprOps.arithmeticOperators.Add;
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.binaryExprOps.arithmeticOperators.Divide;
 import 
org.apache.pig.impl.physicalLayer.topLevelOperators.expressionOperators.binaryExprOps.arithmeticOperators.Mod;
@@ -424,15 +428,14 @@
      * @throws ExecException
      */
     public static POLocalRearrange topLocalRearrangeOPWithPlan(int index, int 
grpCol, Tuple sample) throws ExecException, PlanException{
-        POGenerate gen = topGenerateOpWithExPlanLR(grpCol, sample);
-        PhysicalPlan<PhysicalOperator> pp = new 
PhysicalPlan<PhysicalOperator>();
-        pp.add(gen);
-        
-        POLocalRearrange ret = topLocalRearrangeOp();
-        ret.setPlan(pp);
-        ret.setIndex(index);
-        ret.setResultType(DataType.TUPLE);
-        return ret;
+        POLocalRearrange lr = topLocalRearrangeOPWithPlanPlain(index, grpCol, 
sample);
+        List<ExprPlan> plans = lr.getPlans(); 
+        ExprPlan ep = plans.get(0);
+        POCast cst = new POCast(new OperatorKey("", r.nextLong()));
+        cst.setResultType(sample.getType(grpCol));
+        ep.addAsLeaf(cst);
+        lr.setPlans(plans);
+        return lr;
     }
     
     /**
@@ -445,14 +448,20 @@
      * @throws ExecException
      */
     public static POLocalRearrange topLocalRearrangeOPWithPlanPlain(int index, 
int grpCol, Tuple sample) throws ExecException, PlanException{
-        POGenerate gen = topGenerateOpWithExPlan(grpCol, sample);
-        PhysicalPlan<PhysicalOperator> pp = new 
PhysicalPlan<PhysicalOperator>();
-        pp.add(gen);
+        POProject prj1 = new POProject(new OperatorKey("", r.nextLong()), -1, 
grpCol);
+        prj1.setResultType(sample.getType(grpCol));
+        prj1.setOverloaded(false);
+
+        ExprPlan plan1 = new ExprPlan();
+        plan1.add(prj1);
         
+        List<ExprPlan> plans = new ArrayList<ExprPlan>();
+        plans.add(plan1);
         POLocalRearrange ret = topLocalRearrangeOp();
-        ret.setPlan(pp);
+        ret.setPlans(plans);
         ret.setIndex(index);
         ret.setResultType(DataType.TUPLE);
+        ret.setKeyType(sample.getType(grpCol));
         return ret;
     }
     
@@ -767,6 +776,36 @@
         return ret;
     }
     
+    public static POForEach topForEachOPWithUDF(List<String> clsName) throws 
PlanException{
+        List<ExprPlan> ep4s = new ArrayList<ExprPlan>();
+        List<Boolean> flattened3 = new ArrayList<Boolean>();
+        for (String string : clsName) {
+            ExprPlan ep4 = new ExprPlan();
+            POProject prjStar4 = new POProject(new OperatorKey("", 
r.nextLong()));
+            prjStar4.setResultType(DataType.TUPLE);
+            prjStar4.setStar(true);
+            ep4.add(prjStar4);
+            
+            List ufInps = new ArrayList();
+            ufInps.add(prjStar4);
+            POUserFunc uf = new POUserFunc(new OperatorKey("", r.nextLong()), 
-1, ufInps, string);
+            ep4.add(uf);
+            ep4.connect(prjStar4, uf);
+            ep4s.add(ep4);
+            flattened3.add(false);
+        }
+        
+        POGenerate finGen = new POGenerate(new OperatorKey("", r.nextLong()), 
ep4s, flattened3);
+        
+        PhysicalPlan<PhysicalOperator> fe3Plan = new 
PhysicalPlan<PhysicalOperator>();
+        fe3Plan.add(finGen);
+        
+        POForEach fe3 = new POForEach(new OperatorKey("", r.nextLong()));
+        fe3.setPlan(fe3Plan);
+        fe3.setResultType(DataType.TUPLE);
+        return fe3;
+    }
+    
     public static ExprPlan arithPlan() throws PlanException{
         ExprPlan ep = new ExprPlan();
         ConstantExpression ce[] = new ConstantExpression[7];


Reply via email to