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

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


                        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


        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

        Tuple tmpTpl = new DefaultTuple();
        tmpTpl.append(inp);
        inpPrj.setColumn(0);
        inpPrj.setResultType(DataType.TUPLE);
        inpPrj.setOverloaded(true);
        inpPrj.attachInput(tmpTpl);
        List<PhysicalOperator> inputs = new ArrayList<PhysicalOperator>();
        inputs.add(inpPrj);
        projFil.setInputs(inputs);
    }
View Full Code Here

      List<PhysicalOperator> inputs = new ArrayList<PhysicalOperator>();
      inputs.add(proj);
      cast.setInputs(inputs);
      Tuple tuple = TupleFactory.getInstance().newTuple(1);
      tuple.set(0, "1.2345");
      proj.attachInput(tuple);

      // Create POSplit and attach the above cast op as input
      POSplit split = new POSplit(new OperatorKey("", r.nextLong()), -1);
      inputs = new ArrayList<PhysicalOperator>();
      inputs.add(cast);
View Full Code Here

        DataBag inpDb = GenRandomData.genRandSmallTupDataBag(r, numTuples, 1000);
       
        POProject proj = new POProject(new OperatorKey("", r.nextLong()));
        Tuple t = new DefaultTuple();
        t.append(inpDb);
        proj.attachInput(t);
        proj.setColumn(0);
        proj.setOverloaded(true);
        proj.setResultType(DataType.TUPLE);
       
        List<PhysicalOperator> inps = new ArrayList<PhysicalOperator>();
View Full Code Here

        DataBag inpDb = GenRandomData.genRandSmallTupDataBag(r, numTuples, 1000);
       
        POProject proj = new POProject(new OperatorKey("", r.nextLong()));
        Tuple t = new DefaultTuple();
        t.append(inpDb);
        proj.attachInput(t);
        proj.setColumn(0);
        proj.setOverloaded(true);
        proj.setResultType(DataType.TUPLE);
       
        List<PhysicalOperator> inps = new ArrayList<PhysicalOperator>();
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);
        fe.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

        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.