Examples of attachInput()


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

        //DataBag obtained = bf.newDefaultBag();
        List<String> obtained = new LinkedList<String>();
        for (Tuple t : cogroup) {
            /*plan1.attachInput(t);
            plan2.attachInput(t);*/
            poGen.attachInput(t);
            Result output = poGen.getNextTuple();
            while(output.result != null && output.returnStatus != POStatus.STATUS_EOP) {
                //System.out.println(output.result);
                obtained.add(((Tuple) output.result).toString());
                output = poGen.getNextTuple();
View Full Code Here

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

    public static boolean test(byte type) throws ExecException {
        Random r = new Random();
        ConstantExpression lt = (ConstantExpression)GenPhyOp.exprConst();
        lt.setResultType(type);
        Tuple dummyTuple = TupleFactory.getInstance().newTuple(1);
        lt.attachInput(dummyTuple);
        POIsNull isNullExpr = (POIsNull)GenPhyOp.compIsNullExpr();
        isNullExpr.setExpr(lt);
        isNullExpr.setOperandType(type);

        Object inp1;
View Full Code Here

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.getNext(dummyDouble).result;
      if (doubleExpected[i] != null) {
        assertEquals(doubleExpected[i], actual, 1e-6);
      } else {
        assertNull(actual);
View Full Code Here

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

    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.getNext(dummyFloat).result;
      if (floatExpected[i] != null) {
        assertEquals(floatExpected[i], actual, 1e-6);
      } else {
        assertNull(actual);
View Full Code Here

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

        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.getNext(dummyLong).result;
      if (longExpected[i] != null) {
        assertEquals(longExpected[i], actual);
      } else {
        assertNull(actual);
View Full Code Here

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.getNext(dummyInteger).result;
      if (intExpected[i] != null) {
        assertEquals(intExpected[i], actual);
      } else {
        assertNull(actual);
View Full Code Here

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

        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

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

        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

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

    Iterator<Tuple> it = input.iterator();
    Tuple t1 = it.next();
    Tuple t2 = it.next();
    t1.append(2);
    t2.append(3);
    userFunc.attachInput(t1, t2);
    Integer i = null;
    // System.out.println(t1 + " " + t2);
    int result = (Integer) (userFunc.getNextInteger().result);
    assertEquals(-1, result);
  }
View Full Code Here

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

        null, new FuncSpec(funcSpec));

                //************ Initial Calculations ******************
    TupleFactory tf = TupleFactory.getInstance();
    po.setAlgebraicFunction(INIT);
    po.attachInput(tup1);
    Tuple t = null;
    Result res = po.getNextTuple();
    Tuple outputInitial1 = (res.returnStatus == POStatus.STATUS_OK) ? (Tuple) res.result
        : null;
    Tuple outputInitial2 = (res.returnStatus == POStatus.STATUS_OK) ? (Tuple) res.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.