Package org.apache.pig.data

Examples of org.apache.pig.data.TupleFactory.newTuple()


      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(i, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append((new Float(r.nextFloat())).toString());
      plan.attachInput(t);
      Float i = Float.valueOf(((String) t.get(0)));
      Result res = op.getNext(i);
      if(res.returnStatus == POStatus.STATUS_OK) {
View Full Code Here


      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(i, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append((new Long(r.nextLong())).toString());
      plan.attachInput(t);
      Long i = Long.valueOf(((String) t.get(0)));
      Result res = op.getNext(i);
      if(res.returnStatus == POStatus.STATUS_OK) {
View Full Code Here

      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(i, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append((new Double(r.nextDouble())).toString());
      plan.attachInput(t);
      Double i = Double.valueOf(((String) t.get(0)));
      Result res = op.getNext(i);
      if(res.returnStatus == POStatus.STATUS_OK) {
View Full Code Here

      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(i, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append(GenRandomData.genRandString(r));
      plan.attachInput(t);
      String str = (String) t.get(0);
      Result res = op.getNext(str);
      if(res.returnStatus == POStatus.STATUS_OK) {
View Full Code Here

      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(str, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append(GenRandomData.genRandString(r));
   
      plan.attachInput(t);
      DataByteArray dba = new DataByteArray(((String)t.get(0)).getBytes());
      Result res = op.getNext(dba);
View Full Code Here

      if(res.returnStatus == POStatus.STATUS_OK)
        assertEquals(dba, res.result);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append(GenRandomData.genRandString(r));
      plan.attachInput(t);
      Map map = null;
      Result res = op.getNext(map);
      assertEquals(POStatus.STATUS_ERR, res.returnStatus);
View Full Code Here

      Result res = op.getNext(map);
      assertEquals(POStatus.STATUS_ERR, res.returnStatus);
    }
   
    {
      Tuple t = tf.newTuple();
      t.append(GenRandomData.genRandString(r));
      plan.attachInput(t);
      Result res = op.getNext(t);
      assertEquals(POStatus.STATUS_ERR, res.returnStatus);
    }
View Full Code Here

      plan.attachInput(t);
      Result res = op.getNext(t);
      assertEquals(POStatus.STATUS_ERR, res.returnStatus);
    }
    {
      Tuple t = tf.newTuple();
      t.append(GenRandomData.genRandString(r));
      plan.attachInput(t);
      DataBag b = null;
      Result res = op.getNext(b);
      assertEquals(POStatus.STATUS_ERR, res.returnStatus);
View Full Code Here

    // Plan to test when result type is ByteArray and casting is requested
    // for example casting of values coming out of map lookup.
    POCast opWithInputTypeAsBA = new POCast(new OperatorKey("", r.nextLong()), -1);
    PhysicalPlan planToTestBACasts = constructPlan(opWithInputTypeAsBA);
    {
      Tuple t = tf.newTuple();
      t.append(new DataByteArray((new Integer(r.nextInt())).toString().getBytes()));
      plan.attachInput(t);
      Integer i = Integer.valueOf(((DataByteArray) t.get(0)).toString());
      Result res = op.getNext(i);
      if(res.returnStatus == POStatus.STATUS_OK) {
View Full Code Here

        assertEquals(i, res.result);

    }

    {
      Tuple t = tf.newTuple();
      t.append(new DataByteArray((new Float(r.nextFloat())).toString().getBytes()));
      plan.attachInput(t);
      Float i = Float.valueOf(((DataByteArray) t.get(0)).toString());
      Result res = op.getNext(i);
      if(res.returnStatus == POStatus.STATUS_OK) {
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.