Examples of dumpSchema()


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

        PigServer pig = new PigServer(ExecType.LOCAL);

        boolean foundEx = false;
        try{
            Util.registerMultiLineQuery(pig, query);
            pig.dumpSchema("u");
        }catch(FrontendException e){
            PigException pigEx = LogUtils.getPigException(e);
            foundEx = true;
            if(!pigEx.getMessage().contains(expectedErr)){
                String msg = "Expected exception message matching '"
View Full Code Here

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

                "org.apache.pig.test.TestUnionOnSchema\\$UDFTupleNullSchema(i,j) as uo;"
            + "u = union onschema f1, l2;"
        ;
        Util.registerMultiLineQuery(pig, query);

        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("i: int, cj: chararray, uo: Tuple(), j: chararray");
        assertEquals("Checking expected schema",sch, expectedSch);
       
View Full Code Here

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

            + "f2 = foreach l2 generate i, COUNT(b.c1) as mx;"

        ;
        String query = query_prefix  + "u = union onschema f1, f2;";
        Util.registerMultiLineQuery(pig, query);
        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
        // verify schema for reverse order of relations as well
View Full Code Here

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

        assertEquals("Checking expected schema",sch, expectedSch);
       
        // verify schema for reverse order of relations as well
        query = query_prefix  + "u = union onschema f2, f1;";
        Util.registerMultiLineQuery(pig, query);
        sch = pig.dumpSchema("u");
        expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
View Full Code Here

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

            + "f22 = foreach f2 generate i, mx;"

        ;
        String query = query_prefix  + "u = union onschema f11, f22;";
        Util.registerMultiLineQuery(pig, query);
        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
        // verify schema for reverse order of relations as well
View Full Code Here

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

        assertEquals("Checking expected schema",sch, expectedSch);
       
        // verify schema for reverse order of relations as well
        query = query_prefix  + "u = union onschema f22, f11;";
        Util.registerMultiLineQuery(pig, query);
        sch = pig.dumpSchema("u");
        expectedSch =
            Util.getSchemaFromString("i: int, mx: long");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
View Full Code Here

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

            + "f = load  '" + INP_FILE_2NUMS + "' as (i, j); "
            ;
        String query = query_prefix + "u = union onschema e,f;";
        Util.registerMultiLineQuery(pig, query);

        Schema sch = pig.dumpSchema("u");
        Schema expectedSch =
            Util.getSchemaFromString("gp: int,c::gp: int,i: int,j: int");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
View Full Code Here

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

       
       
        query = query_prefix + "u = union onschema f,e;";
        Util.registerMultiLineQuery(pig, query);

        sch = pig.dumpSchema("u");
        expectedSch =
            Util.getSchemaFromString("i: int,j: int, gp: int,c::gp: int");
        assertEquals("Checking expected schema",sch, expectedSch);
       
       
View Full Code Here

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

    PigServer server = new PigServer(ExecType.LOCAL, props);

    // test that schema was loaded correctly
    server.registerQuery("X = load '"+BASIC_TABLE+"' using org.apache.howl.pig.HowlLoader();");
    Schema dumpedXSchema = server.dumpSchema("X");
    List<FieldSchema> Xfields = dumpedXSchema.getFields();
    assertEquals(2,Xfields.size());
    assertTrue(Xfields.get(0).alias.equalsIgnoreCase("a"));
    assertTrue(Xfields.get(0).type == DataType.INTEGER);
    assertTrue(Xfields.get(1).alias.equalsIgnoreCase("b"));
View Full Code Here

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

    PigServer server = new PigServer(ExecType.LOCAL, props);

    // test that schema was loaded correctly
    server.registerQuery("K = load '"+COMPLEX_TABLE+"' using org.apache.howl.pig.HowlLoader();");
    Schema dumpedKSchema = server.dumpSchema("K");
    List<FieldSchema> Kfields = dumpedKSchema.getFields();
    assertEquals(6,Kfields.size());

    assertEquals(DataType.CHARARRAY,Kfields.get(0).type);
    assertEquals("name",Kfields.get(0).alias.toLowerCase());
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.