Package org.apache.pig.builtin

Examples of org.apache.pig.builtin.COUNT$Final


    @Test
    public void testCOUNT() throws Exception {
        Integer input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null };
        long expected = input.length - 1;

        EvalFunc<Long> count = new COUNT();
        Tuple tup = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1), input);
        Long output = count.exec(tup);

        assertTrue(output == expected);
    }
View Full Code Here


    @Test
    public void testCOUNT() throws Exception {
        Integer input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null };
        long expected = input.length - 1;

        EvalFunc<Long> count = new COUNT();
        Tuple tup = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1), input);
        Long output = count.exec(tup);

        assertTrue(output == expected);
    }
View Full Code Here

    @Test
    public void testCOUNT() throws Exception {
        Integer input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null };
        long expected = input.length - 1;

        EvalFunc<Long> count = new COUNT();
        Tuple tup = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1), input);
        Long output = count.exec(tup);

        assertTrue(output == expected);
    }
View Full Code Here

    @Test
    public void testCOUNT() throws Exception {
        Integer input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null };
        long expected = input.length - 1;

        EvalFunc<Long> count = new COUNT();
        Tuple tup = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1), input);
        Long output = count.exec(tup);

        assertTrue(output == expected);
    }
View Full Code Here

                udfArgs[i] = input.get(i + 4);
            }
        }

        if ("count".equalsIgnoreCase(agg)) {
            func = new COUNT();
        } else if ("sum(double)".equalsIgnoreCase(agg) ||
            "sum(float)".equalsIgnoreCase(agg)) {
            func = new DoubleSum();
        } else if ("sum(int)".equalsIgnoreCase(agg) ||
            "sum(long)".equalsIgnoreCase(agg)) {
View Full Code Here

    @Test
    public void testCOUNT() throws Exception {
        Integer input[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null };
        long expected = input.length - 1;

        EvalFunc<Long> count = new COUNT();
        Tuple tup = Util.loadNestTuple(TupleFactory.getInstance().newTuple(1), input);
        Long output = count.exec(tup);

        assertTrue(output == expected);
    }
View Full Code Here

    @Test
    public void testCOUNTBagNullCheck() throws Exception{
        DataBag b = null;
        Tuple t = TupleFactory.getInstance().newTuple(b);

        EvalFunc<Long> count = new COUNT();
        assertNull(count.exec(t));
       }
View Full Code Here

                udfArgs[i] = input.get(i + 4);
            }
        }

        if ("count".equalsIgnoreCase(agg)) {
            func = new COUNT();
        } else if ("sum(double)".equalsIgnoreCase(agg) ||
            "sum(float)".equalsIgnoreCase(agg)) {
            func = new DoubleSum();
        } else if ("sum(int)".equalsIgnoreCase(agg) ||
            "sum(long)".equalsIgnoreCase(agg)) {
View Full Code Here

import org.apache.pig.data.Tuple;

public class HelperEvalFuncUtils {
    public static class AlgCOUNT extends AlgFunc<Long> {
        public AlgCOUNT() {
            super(new COUNT());
        }
View Full Code Here

        }
    }

    public static class AccCOUNT extends AccFunc<Long> {
        public AccCOUNT() {
            super(new COUNT());
        }
View Full Code Here

TOP

Related Classes of org.apache.pig.builtin.COUNT$Final

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.