Examples of Decode


Examples of org.apache.pig.piggybank.evaluation.decode.Decode

        t4.set(2, "Sales");
        t4.set(3, 1);
        t4.set(4, "Engineering");
        t4.set(5, "Other");
       
        Decode func = new Decode();
        String r = func.exec(t1);
        assertTrue(r.equals("Engineering"));       
        r = func.exec(t2);
        assertTrue(r.equals("Other"));
        r = func.exec(t3);
        assertTrue(r==null);
        try {
            r = func.exec(t4);
            fail("Exception not triggered");
        } catch (IOException e) {
            assertTrue(e.getMessage().equals("Decode : Encounter null in the input"));
        }
    }
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.