Examples of outputSchema()


Examples of org.apache.pig.builtin.BagToString.outputSchema()


    Schema inputSch = new Schema();

    BagToString udf = new BagToString();
    Schema outputSchema = udf.outputSchema(inputSch);

    assertEquals("schema of BagToTuple input", outputSchema.getField(0).type,
        DataType.CHARARRAY);

  }
View Full Code Here

Examples of org.apache.pig.builtin.BagToString.outputSchema()

    Schema inputSch = new Schema();
    inputSch.add(bagSch);
    inputSch.add(new FieldSchema(null, DataType.CHARARRAY));

    BagToString udf = new BagToString();
    Schema outputSchema = udf.outputSchema(inputSch);

    assertEquals("schema of BagToTuple input", outputSchema.getField(0).type,
        DataType.CHARARRAY);

  }
View Full Code Here

Examples of org.apache.pig.builtin.BagToString.outputSchema()

    Schema inputSch = new Schema();
    inputSch.add(bagSch);

    BagToString udf = new BagToString();
    Schema outputSchema = udf.outputSchema(inputSch);

    assertEquals("schema of BagToTuple input", outputSchema.getField(0).type,
        DataType.CHARARRAY);

  }
View Full Code Here

Examples of org.apache.pig.builtin.BagToString.outputSchema()

    inputSch.add(bagSch);
    inputSch.add(new FieldSchema(null, DataType.DOUBLE));

    BagToString udf = new BagToString();
    // expecting an exception because the delimiter is not of type Data.CHARARRAY
    udf.outputSchema(inputSch);
  }

  @Test
  public void testPigScriptForBagToTupleUDF() throws Exception {
    PigServer pigServer = new PigServer(ExecType.LOCAL);
View Full Code Here

Examples of org.apache.pig.builtin.BagToTuple.outputSchema()

    Schema inputSch = new Schema();
    inputSch.add(bagSch);

    BagToTuple udf = new BagToTuple();
    Schema outputSchema = udf.outputSchema(inputSch);

    assertEquals("schema of BagToTuple input", expectedSch.size(),
        outputSchema.size());
    assertTrue("schema of BagToTuple input",
        Schema.equals(expectedSch, outputSchema, false, true));
View Full Code Here

Examples of org.apache.pig.builtin.TOBAG.outputSchema()

        inputSch.add(new FieldSchema("c", tupInSchema, DataType.TUPLE));
        //expect null inner schema
        expectedSch =
            Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
        assertEquals("schema of tobag when input has cols of type tuple with diff inner schema",
                expectedSch, tb.outputSchema(inputSch));

       
       
        Tuple input = TupleFactory.getInstance().newTuple();
        for (int i = 0; i < 100; ++i) {
View Full Code Here

Examples of org.apache.pig.builtin.TOBAG.outputSchema()

        //check schema of TOBAG when given input tuple having only integers
        Schema inputSch = new Schema();
        inputSch.add(new FieldSchema(null, DataType.INTEGER));
        assertEquals("schema of tobag when input has only ints",
                expectedSch, tb.outputSchema(inputSch));

        //add another int column
        inputSch.add(new FieldSchema(null, DataType.INTEGER));
        assertEquals("schema of tobag when input has only ints",
                expectedSch, tb.outputSchema(inputSch));
View Full Code Here

Examples of org.apache.pig.builtin.TOBAG.outputSchema()

                expectedSch, tb.outputSchema(inputSch));

        //add another int column
        inputSch.add(new FieldSchema(null, DataType.INTEGER));
        assertEquals("schema of tobag when input has only ints",
                expectedSch, tb.outputSchema(inputSch));

        //add a long column
        inputSch.add(new FieldSchema(null, DataType.LONG));
        //expect null inner schema
        expectedSch =
View Full Code Here

Examples of org.apache.pig.builtin.TOBAG.outputSchema()

        inputSch.add(new FieldSchema(null, DataType.LONG));
        //expect null inner schema
        expectedSch =
            Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
        assertEquals("schema of tobag when input has ints and long",
                expectedSch, tb.outputSchema(inputSch));

       
        //test schema when input is a tuple with inner schema
        Schema tupInSchema = new Schema(new FieldSchema("x", DataType.CHARARRAY));
        inputSch = new Schema();
View Full Code Here

Examples of org.apache.pig.builtin.TOBAG.outputSchema()

        inputSch.add(new FieldSchema("a", tupInSchema, DataType.TUPLE));
        Schema inputSchCp = new Schema(inputSch);
        inputSchCp.getField(0).alias = null;
        expectedSch = new Schema(new FieldSchema(null, inputSchCp, DataType.BAG));
        assertEquals("schema of tobag when input has cols of type tuple ",
                expectedSch, tb.outputSchema(inputSch));
       
        inputSch.add(new FieldSchema("b", tupInSchema, DataType.TUPLE));
        assertEquals("schema of tobag when input has cols of type tuple ",
                expectedSch, tb.outputSchema(inputSch));
       
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.