Package org.apache.pig

Examples of org.apache.pig.PigServer.openIterator()


            + "u = union onSchema l1, l2;"
        ;
        Util.registerMultiLineQuery(pig, query);
        pig.explain("u", System.out);

        Iterator<Tuple> it = pig.openIterator("u");
       
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1L,null,2,{(1,'a'),(1,'b')},'abc')",
View Full Code Here


        Schema expectedSch =
            Util.getSchemaFromString("i: int, cj: chararray, uo: Tuple(), j: chararray");
        assertEquals("Checking expected schema",sch, expectedSch);
       

        Iterator<Tuple> it = pig.openIterator("u");
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1,null,null,'2')",
                            "(5,null,null,'3')",
View Full Code Here

        expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
        Iterator<Tuple> it = pig.openIterator("u");
       
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1,1L)",
View Full Code Here

        expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
        Iterator<Tuple> it = pig.openIterator("u");
       
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1,1L)",
View Full Code Here

        expectedSch =
            Util.getSchemaFromString("i: int,j: int, gp: int,c::gp: int");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
        Iterator<Tuple> it = pig.openIterator("u");
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1,2,null,null)",
                            "(5,3,null,null)",
View Full Code Here

            + "u1 = union onschema l1, l2;"
            + "l3 = load '" + INP_FILE_2NUMS + "' as (i : long, j : double);"
            + "u2 = union onschema u1, l3;"
        ;
        Util.registerMultiLineQuery(pig, query);
        Iterator<Tuple> it = pig.openIterator("u2");
       
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
                    new String[] {
                            "(1L,2.0)",
View Full Code Here

        String query =
            "  l1 = load '" + INPUT_FILE + "' ;"
            + "f1 = foreach l1 generate * ;"
        ;
        Util.registerMultiLineQuery(pig, query);
        Iterator<Tuple> it = pig.openIterator("f1");
       
        Tuple expectedResCharArray = (Tuple)Util.getPigConstant("('one','two')");
        Tuple expectedRes = TupleFactory.getInstance().newTuple();
        for(Object field :  expectedResCharArray.getAll() ){
            expectedRes.append(new DataByteArray(field.toString()));
View Full Code Here

                + Util.generateURI(gzFile.toString(), pig.getPigContext())
                + "') by $1, (load '"
                + Util.generateURI(datFile.toString(), pig.getPigContext())
                + "') by $1) generate flatten( " + DIFF.class.getName()
                + "($1.$1,$2.$1)) ;");
        Iterator<Tuple> it = pig.openIterator("A");
        boolean success = true;
        while(it.hasNext()) {
            success = false;
            log.info(it.next());
        }
View Full Code Here

                + Util.generateURI(gzFile.toString(), pig.getPigContext())
                + "';");
        DataBag dbGz = BagFactory.getInstance().newDefaultBag(), dbDt = BagFactory.getInstance().newDefaultBag();
        {
            Iterator<Tuple> iter = pig.openIterator("A");

            while(iter.hasNext()) {
                dbGz.add(iter.next());
            }           
        }
View Full Code Here

            }           
        }
        pig.registerQuery("B = load '"       
                + Util.generateURI(datFile.toString(), pig.getPigContext())
                + "';");
        Iterator<Tuple> iter = pig.openIterator("B");

        while(iter.hasNext()) {
            dbDt.add(iter.next());
        }
       
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.