Package org.pygmalion.udf

Examples of org.pygmalion.udf.RangeBasedStringConcat.exec()


        RangeBasedStringConcat rbsc = new RangeBasedStringConcat("ALL", " ");
        Tuple input = new DefaultTuple();
        for (int i = 0; i < fields.length; i++) {
            input.append(fields[i]);
        }
        String result = rbsc.exec(input);
        assertEquals("a b c d e f g h i", result);
        Tuple innerTuple = new DefaultTuple();
        innerTuple.append("j");
        innerTuple.append("k");
View Full Code Here


        Tuple innerTuple = new DefaultTuple();
        innerTuple.append("j");
        innerTuple.append("k");

        input.append(innerTuple);
        result = rbsc.exec(input);
        assertEquals("a b c d e f g h i j k", result);
        DataBag db = new DefaultDataBag();
        Tuple dbTuple = new DefaultTuple();
        dbTuple.append("l");
        dbTuple.append("m");
View Full Code Here

        Tuple dbTuple = new DefaultTuple();
        dbTuple.append("l");
        dbTuple.append("m");
        db.add(dbTuple);
        innerTuple.append(db);
        result = rbsc.exec(input);
        assertEquals("a b c d e f g h i j k l m", result);
    }

    @Test
    public void testRange() throws Exception {
View Full Code Here

        RangeBasedStringConcat rbsc = new RangeBasedStringConcat("0,1", " ");
        Tuple input = new DefaultTuple();
        for (String field : fields) {
            input.append(field);
        }
        String result = rbsc.exec(input);
        assertEquals("a b", result);
        rbsc = new RangeBasedStringConcat("2,6", " ");
        result = rbsc.exec(input);
        assertEquals("c g", result);
        //test out of range
View Full Code Here

            input.append(field);
        }
        String result = rbsc.exec(input);
        assertEquals("a b", result);
        rbsc = new RangeBasedStringConcat("2,6", " ");
        result = rbsc.exec(input);
        assertEquals("c g", result);
        //test out of range
        rbsc = new RangeBasedStringConcat("0,9,1000", " ");
        result = rbsc.exec(input);
        assertEquals("a", result);
View Full Code Here

        rbsc = new RangeBasedStringConcat("2,6", " ");
        result = rbsc.exec(input);
        assertEquals("c g", result);
        //test out of range
        rbsc = new RangeBasedStringConcat("0,9,1000", " ");
        result = rbsc.exec(input);
        assertEquals("a", result);

        Tuple innerTuple = new DefaultTuple();
        innerTuple.append("j");
        innerTuple.append("k");
View Full Code Here

        innerTuple.append("j");
        innerTuple.append("k");

        input.append(innerTuple);
        rbsc = new RangeBasedStringConcat("0,9", " ");
        result = rbsc.exec(input);
        assertEquals("a j k", result);
        DataBag db = new DefaultDataBag();
        Tuple dbTuple = new DefaultTuple();
        dbTuple.append("l");
        dbTuple.append("m");
View Full Code Here

        dbTuple.append("l");
        dbTuple.append("m");
        db.add(dbTuple);
        innerTuple.append(db);
        rbsc = new RangeBasedStringConcat("0,9,10", " ");
        result = rbsc.exec(input);
        assertEquals("a j k l m", result);
    }
}
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.