Examples of dumpSchema()


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

            PigServer pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
            pig.registerQuery("A = LOAD 'a.txt';");
            pig.registerQuery("B = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF1();");
            pig.registerQuery("C = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF2();");
            pig.registerQuery("D = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF3();");
            Schema s = pig.dumpSchema("B");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("C");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("D");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
View Full Code Here

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

            pig.registerQuery("B = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF1();");
            pig.registerQuery("C = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF2();");
            pig.registerQuery("D = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF3();");
            Schema s = pig.dumpSchema("B");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("C");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("D");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

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

            pig.registerQuery("D = FOREACH A GENERATE org.apache.pig.test.utils.MultiLevelDerivedUDF3();");
            Schema s = pig.dumpSchema("B");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("C");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
            s = pig.dumpSchema("D");
            assertTrue(s.getField(0).type == DataType.DOUBLE);
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }
View Full Code Here

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

            + "l2 = load '" + INP_FILE_2NUMS + "' as (i : int, j : int);"
            + "u = union onschema l1, l2;"
        ;
        Util.registerMultiLineQuery(pig, query);
        Schema expectedSch = Util.getSchemaFromString("i: int, j: int");
        Schema sch = pig.dumpSchema("u");
        assertEquals("Checking expected schema",sch, expectedSch);
        Iterator<Tuple> it = pig.openIterator("u");
       
        List<Tuple> expectedRes =
            Util.getTuplesFromConstantTupleStrings(
View Full Code Here

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

            + "u = union onschema l1, l2;"
            + "fil = filter u by i == 5 and (x is null or x != 1);"
        ;
        Util.registerMultiLineQuery(pig, query);
       
        Schema sch = pig.dumpSchema("fil");
        Schema expectedSch = Util.getSchemaFromString("i: int, x: int, j: int");
        assertEquals("Checking expected schema",sch, expectedSch);
       

        Iterator<Tuple> it = pig.openIterator("fil");
View Full Code Here

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

            + "lim = limit o 2;"
            + "fil = filter lim by i == 5 and y is null;"
        ;
        Util.registerMultiLineQuery(pig, query);       
       
        Schema sch = pig.dumpSchema("fil");
        Schema expectedSch = Util.getSchemaFromString("i: int, x: int, y: int");
        assertEquals("Checking expected schema",sch, expectedSch);
       

        Iterator<Tuple> it = pig.openIterator("fil");
View Full Code Here

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

        + "f = foreach g generate flatten(l1); "
        + "l2 = load '" + INP_FILE_2NUMS + "' as (i : int, j : int); ";

        String query = query_prefix + "u = union onschema f, l2; " ;
        Util.registerMultiLineQuery(pig, query);
        Schema sch = pig.dumpSchema("u");
        Schema expectedSch = Util.getSchemaFromString("i: int, j: int");
        assertEquals("Checking expected schema",sch, expectedSch);
        Iterator<Tuple> it = pig.openIterator("u");

        List<Tuple> expectedRes =
View Full Code Here

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

        Util.checkQueryOutputsAfterSort(it, expectedRes);
       
        // now try reversing the order of relation
        query = query_prefix + "u = union onschema l2, f; " ;
        Util.registerMultiLineQuery(pig, query);
        sch = pig.dumpSchema("u");
        expectedSch = Util.getSchemaFromString("i: int, j: int");
        assertEquals("Checking expected schema",sch, expectedSch);
        it = pig.openIterator("u");
        Util.checkQueryOutputsAfterSort(it, expectedRes);
View Full Code Here

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

        + "g2 = group l2 by i; "
        + "f2 = foreach g2 generate group as gkey, flatten(l2); "
        + "u = union onschema f1, f2; " ;
        Util.registerMultiLineQuery(pig, query);
       
        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("gkey: int, l1::i: int, l1::j: int, l2::i: int, l2::x: chararray");
        assertEquals("Checking expected schema",sch, expectedSch);

        Iterator<Tuple> it = pig.openIterator("u");
View Full Code Here

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

            + " cg2 = cogroup l2 by i, l1 by i; "
            + " f2 = foreach cg1 generate group as gkey, flatten(l2), flatten(l1); "
            + "u = union onschema f1, f2; " ;
        Util.registerMultiLineQuery(pig, query);
               
        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("gkey: int, l1::i: int, l1::j: int, l2::i: int, l2::x: chararray");
        assertEquals("Checking expected schema",sch, expectedSch);

        Iterator<Tuple> it = pig.openIterator("u");
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.