Package org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POProject.attachInput()


        Double[] doubleExpected = { 12.0, -13.2, 0.1, 1.3e2, null, MaxDouble,
                        MinDouble };
        for (int i = 0; i < items.length; ++i) {
            Tuple tuple = TupleFactory.getInstance().newTuple(1);
            tuple.set(0, items[i]);
            proj.attachInput(tuple);
            Double actual = (Double)cast.getNextDouble().result;
            if (doubleExpected[i] != null) {
                assertEquals(doubleExpected[i], actual, 1e-6);
            } else {
                assertNull(actual);
View Full Code Here


        Float[] floatExpected = { 12.0f, -13.2f, 0.1f, 1.3e2f, MaxFloat,
                        MinFloat, null };
        for (int i = 0; i < items.length; ++i) {
            Tuple tuple = TupleFactory.getInstance().newTuple(1);
            tuple.set(0, items[i]);
            proj.attachInput(tuple);
            Float actual = (Float)cast.getNextFloat().result;
            if (floatExpected[i] != null) {
                assertEquals(floatExpected[i], actual, 1e-6);
            } else {
                assertNull(actual);
View Full Code Here

                        MinLong.toString(), "df1.2" };
        Long[] longExpected = { 1L, -1L, 12L, 12L, MaxLong, MinLong, null };
        for (int i = 0; i < items.length; ++i) {
            Tuple tuple = TupleFactory.getInstance().newTuple(1);
            tuple.set(0, items[i]);
            proj.attachInput(tuple);
            Long actual = (Long)cast.getNextLong().result;
            if (longExpected[i] != null) {
                assertEquals(longExpected[i], actual);
            } else {
                assertNull(actual);
View Full Code Here

                        MaxInteger.toString(), MinInteger.toString(), "ff4332" };
        Integer[] intExpected = { 1, -1, 12, 12, MaxInteger, MinInteger, null };
        for (int i = 0; i < items.length; ++i) {
            Tuple tuple = TupleFactory.getInstance().newTuple(1);
            tuple.set(0, items[i]);
            proj.attachInput(tuple);
            Integer actual = (Integer)cast.getNextInteger().result;
            if (intExpected[i] != null) {
                assertEquals(intExpected[i], actual);
            } else {
                assertNull(actual);
View Full Code Here

        proj.setColumn(0);
        proj.setResultType(DataType.TUPLE);
        proj.setOverloaded(true);
        Tuple t = new DefaultTuple();
        t.append(db);
        proj.attachInput(t);
        List<PhysicalOperator> inputs = new ArrayList<PhysicalOperator>();
        inputs.add(proj);
        lr.setInputs(inputs);
    }
View Full Code Here

        proj.setColumn(0);
        proj.setResultType(DataType.TUPLE);
        proj.setOverloaded(true);
        Tuple t = new DefaultTuple();
        t.append(db);
        proj.attachInput(t);
        List<PhysicalOperator> inputs = new ArrayList<PhysicalOperator>();
        inputs.add(proj);
        lr.setInputs(inputs);
    }
   
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.