Package org.apache.pig.data

Examples of org.apache.pig.data.SingleTupleBag


        Tuple output = mTupleFactory.newTuple(2);
        output.set(0, key);
        // put the value in a bag so that the initial
        // version of the Algebraics will get a bag as
        // they would expect.
        DataBag bg = new SingleTupleBag(value);
        output.set(1, bg);
        return output;
    }
View Full Code Here


                    // don't catch it, we will die and the most common case for the
                    // exception would be because the tuple is null
                    tmpTuple.set(i, null);
                }
            }
            outBag = new SingleTupleBag(tmpTuple);
        } else {
            outBag = bagFactory.newDefaultBag();
            for (Tuple tuple : inpBag) {
                Tuple tmpTuple = tupleFactory.newTuple(columns.size());
                for (int i = 0; i < columns.size(); i++) {
View Full Code Here

    public void testSingleTupleBagAcess() throws Exception {
        Tuple inputTuple = new DefaultTuple();
        inputTuple.append("a");
        inputTuple.append("b");
       
        SingleTupleBag bg = new SingleTupleBag(inputTuple);
        Iterator<Tuple> it = bg.iterator();
        assertEquals(inputTuple, it.next());
        assertFalse(it.hasNext());
    }
View Full Code Here

                    // don't catch it, we will die and the most common case for the
                    // exception would be because the tuple is null
                    tmpTuple.set(i, null);
                }
            }
            outBag = new SingleTupleBag(tmpTuple);
        } else {
            outBag = bagFactory.newDefaultBag();
            for (Tuple tuple : inpBag) {
                Tuple tmpTuple = tupleFactory.newTuple(columns.size());
                for (int i = 0; i < columns.size(); i++) {
View Full Code Here

        Tuple output = mTupleFactory.newTuple(2);
        output.set(0, key);
        // put the value in a bag so that the initial
        // version of the Algebraics will get a bag as
        // they would expect.
        DataBag bg = new SingleTupleBag(value);
        output.set(1, bg);
        return output;
    }
View Full Code Here

    public void testSingleTupleBagAcess() throws Exception {
        Tuple inputTuple = new DefaultTuple();
        inputTuple.append("a");
        inputTuple.append("b");
       
        SingleTupleBag bg = new SingleTupleBag(inputTuple);
        Iterator<Tuple> it = bg.iterator();
        assertEquals(inputTuple, it.next());
        assertFalse(it.hasNext());
    }
View Full Code Here

    public void testSingleTupleBagAcess() throws Exception {
        Tuple inputTuple = new DefaultTuple();
        inputTuple.append("a");
        inputTuple.append("b");
       
        SingleTupleBag bg = new SingleTupleBag(inputTuple);
        Iterator<Tuple> it = bg.iterator();
        assertEquals(inputTuple, it.next());
        assertFalse(it.hasNext());
    }
View Full Code Here

            // appropriately from the input bag
            Tuple tuple = inpBag.iterator().next();
            Tuple tmpTuple = tupleFactory.newTuple(columns.size());
            for (int i = 0; i < columns.size(); i++)
                tmpTuple.set(i, tuple.get(columns.get(i)));
            outBag = new SingleTupleBag(tmpTuple);
        } else {
            outBag = bagFactory.newDefaultBag();
            for (Tuple tuple : inpBag) {
                Tuple tmpTuple = tupleFactory.newTuple(columns.size());
                for (int i = 0; i < columns.size(); i++)
View Full Code Here

    public void testSingleTupleBagAcess() throws Exception {
        Tuple inputTuple = new DefaultTuple();
        inputTuple.append("a");
        inputTuple.append("b");
       
        SingleTupleBag bg = new SingleTupleBag(inputTuple);
        Iterator<Tuple> it = bg.iterator();
        assertEquals(inputTuple, it.next());
        assertFalse(it.hasNext());
    }
View Full Code Here

        Tuple output = mTupleFactory.newTuple(2);
        output.set(0, key);
        // put the value in a bag so that the initial
        // version of the Algebraics will get a bag as
        // they would expect.
        DataBag bg = new SingleTupleBag(value);
        output.set(1, bg);
        return output;
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.data.SingleTupleBag

Copyright © 2018 www.massapicom. 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.