Package org.apache.pig.piggybank.evaluation.string

Examples of org.apache.pig.piggybank.evaluation.string.UPPER


public class TestEvalString extends TestCase {
 
    @Test
    public void testUPPER() throws Exception {
        UPPER func = new UPPER();

        // test excution
        String data = "Hello World!";
        String expected = "HELLO WORLD!";

        DataAtom field = new DataAtom(data);
        Tuple input = new Tuple(field);
        DataAtom output = new DataAtom();

        func.exec(input, output);
        assertTrue(output.strval().equals(expected));

        // test schema creation
        String fieldName = "field1";
        AtomSchema fieldSchema = new AtomSchema(fieldName);
        TupleSchema tupleSchema = new TupleSchema();
        tupleSchema.add(fieldSchema, false);
        Schema outSchema = func.outputSchema(tupleSchema);
        assertTrue(outSchema.toString().equals("upper_" + fieldName));

    }
View Full Code Here


public class TestEvalString extends TestCase {
 
    @Test
    public void testUPPER() throws Exception {
        UPPER func = new UPPER();

        // test excution
        String in = "Hello World!";
        String expected = "HELLO WORLD!";

        Tuple input = DefaultTupleFactory.getInstance().newTuple(in);

        String output = func.exec(input);
        assertTrue(output.equals(expected));

        // test schema creation

        // FIXME
View Full Code Here

TOP

Related Classes of org.apache.pig.piggybank.evaluation.string.UPPER

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.