Package org.apache.pig.builtin

Examples of org.apache.pig.builtin.TRIM


        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inpuStrExtra);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
View Full Code Here


        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inpuStrExtra);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
View Full Code Here

        assertEquals("foobar".replace("oo", "aa"), replace.exec(testTuple));
    }
   
    @Test
    public void testTrim() throws IOException {
        TRIM trim = new TRIM();
        Tuple testTuple = Util.buildTuple("nospaces");
        assertEquals("nospaces".trim(), trim.exec(testTuple));
       
        testTuple = Util.buildTuple("spaces    ");
        assertEquals("spaces     ".trim(), trim.exec(testTuple));
       
        testTuple = TupleFactory.getInstance().newTuple();
        assertNull(trim.exec(testTuple));
    }
View Full Code Here

        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inpuStrExtra);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
       
View Full Code Here

        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));

        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inputStrSpaceBoth);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
View Full Code Here

        assertEquals("foobar".replace("oo", "aa"), replace.exec(testTuple));
    }
   
    @Test
    public void testTrim() throws IOException {
        TRIM trim = new TRIM();
        Tuple testTuple = Util.buildTuple("nospaces");
        assertEquals("nospaces".trim(), trim.exec(testTuple));
       
        testTuple = Util.buildTuple("spaces right    ");
        assertEquals("spaces right", trim.exec(testTuple));
       
        testTuple = Util.buildTuple("    spaces left");
        assertEquals("spaces left", trim.exec(testTuple));
       
        testTuple = Util.buildTuple("    spaces both    ");
        assertEquals("spaces both", trim.exec(testTuple));
       
        testTuple = TupleFactory.getInstance().newTuple();
        assertNull(trim.exec(testTuple));
    }
View Full Code Here

        assertEquals("foobar".replace("oo", "aa"), replace.exec(testTuple));
    }
   
    @Test
    public void testTrim() throws IOException {
        TRIM trim = new TRIM();
        Tuple testTuple = Util.buildTuple("nospaces");
        assertEquals("nospaces".trim(), trim.exec(testTuple));
       
        testTuple = Util.buildTuple("spaces    ");
        assertEquals("spaces     ".trim(), trim.exec(testTuple));
       
        testTuple = TupleFactory.getInstance().newTuple();
        assertNull(trim.exec(testTuple));
    }
View Full Code Here

        assertEquals("foobar".replace("oo", "aa"), replace.exec(testTuple));
    }
   
    @Test
    public void testTrim() throws IOException {
        TRIM trim = new TRIM();
        Tuple testTuple = Util.buildTuple("nospaces");
        assertEquals("nospaces".trim(), trim.exec(testTuple));
       
        testTuple = Util.buildTuple("spaces right    ");
        assertEquals("spaces right", trim.exec(testTuple));
       
        testTuple = Util.buildTuple("    spaces left");
        assertEquals("spaces left", trim.exec(testTuple));
       
        testTuple = Util.buildTuple("    spaces both    ");
        assertEquals("spaces both", trim.exec(testTuple));
       
        testTuple = TupleFactory.getInstance().newTuple();
        assertNull(trim.exec(testTuple));
    }
View Full Code Here

        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));

        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inputStrSpaceBoth);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
View Full Code Here

        input = TupleFactory.getInstance().newTuple(l);
        expected = "ello";
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));

        strFunc = new TRIM();
        input = TupleFactory.getInstance().newTuple(inputStrSpaceBoth);
        expected = inputStr;
        output = strFunc.exec(input);
        assertTrue(output.equals(expected));
View Full Code Here

TOP

Related Classes of org.apache.pig.builtin.TRIM

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.