Examples of POCogroup


Examples of org.apache.pig.pen.physicalOperators.POCogroup

        List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
        inputs.add(lr1);
        inputs.add(lr2);

        POCogroup poc = new POCogroup(new OperatorKey("", r.nextLong()), -1,
                inputs);

        List<Tuple> expected = new LinkedList<Tuple>();

        Tuple t1 = TupleFactory.getInstance().newTuple();
        t1.append(1);
        DataBag b1 = BagFactory.getInstance().newDefaultBag();
        Tuple temp = TupleFactory.getInstance().newTuple();
        temp.append(1);
        b1.add(temp);
        b1.add(temp);
        t1.append(b1);

        DataBag b2 = BagFactory.getInstance().newDefaultBag();
        b2.add(temp);
        t1.append(b2);

        expected.add(t1);

        t1 = TupleFactory.getInstance().newTuple();
        t1.append(2);
        DataBag b3 = BagFactory.getInstance().newDefaultBag();
        temp = TupleFactory.getInstance().newTuple();
        temp.append(2);
        b3.add(temp);
        t1.append(b3);

        DataBag b4 = BagFactory.getInstance().newDefaultBag();
        b4.add(temp);
        b4.add(temp);
        t1.append(b4);

        expected.add(t1);
        // System.out.println(expected.get(0) + " " + expected.get(1));
        List<Tuple> obtained = new LinkedList<Tuple>();
        for (Result res = poc.getNext(t); res.returnStatus != POStatus.STATUS_EOP; res = poc
                .getNext(t)) {
            System.out.println(res.result);
            obtained.add((Tuple) res.result);
            assertTrue(expected.contains((Tuple) res.result));
        }
View Full Code Here

Examples of org.apache.pig.pen.physicalOperators.POCogroup

        tOut2.append(4);
        DataBag t22 = BagFactory.getInstance().newDefaultBag();
        t22.add(t3);
        tOut2.append(t22);
        expected.add(tOut2);
        POCogroup poc = new POCogroup(new OperatorKey("", r.nextLong()), -1,
                inputs);
        int count = 0;
        for (Result res = poc.getNext(t); res.returnStatus != POStatus.STATUS_EOP; res = poc
                .getNext(t)) {
            System.out.println(res.result);
            count++;
            assertTrue(expected.contains(res.result));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.