Examples of DataByteArray


Examples of org.apache.pig.data.DataByteArray

    tuple.set(0, true); // bool
    tuple.set(1, 1); // int
    tuple.set(2, 1001L); // long
    tuple.set(3, 1.1); // float
    tuple.set(4, "hello\r world, 1\n"); // string
    tuple.set(5, new DataByteArray("hello byte, 1")); // bytes

    String str = tuple.toString();
    Assert.assertTrue(str.equals("T,1,1001,1.1,'hello%0D world%2C 1%0A,#hello byte, 1"));
  }
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

    tuple.set(0, tupRecord1);

    // r2:record(r3:record(f3:float, f4))
    tupRecord2.set(0, tupRecord3);
    tupRecord3.set(0, 1.3);
    tupRecord3.set(1, new DataByteArray("r3 row1 byte array"));
    Assert.assertTrue(tupRecord3.toString().equals("1.3,#r3 row1 byte array"));
    Assert.assertTrue(tupRecord2.toString().equals("1.3,#r3 row1 byte array"));
    tuple.set(1, tupRecord2);
    Assert.assertTrue(tuple.toString().equals("1,1001,1.3,#r3 row1 byte array"));
  }
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

    tupColl1.set(0, 3.1415926);
    tupColl1.set(1, 1.6);
    abs1[0] = 'a';
    abs1[1] = 'a';
    abs1[2] = 'a';
    tupColl1.set(2, new DataByteArray(abs1));
    bag1.add(tupColl1);
    tupColl2.set(0, 123.456789);
    tupColl2.set(1, 100);
    abs2[0] = 'b';
    abs2[1] = 'c';
    abs2[2] = 'd';
    abs2[3] = 'e';
    tupColl2.set(2, new DataByteArray(abs2));
    bag1.add(tupColl2);
    tuple.set(0, bag1);

    collRecord1.set(0, 1);
    collRecord1.set(1, "record1_string1");
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

            tuple.set(0, 100);
            tuple.set(1, 100.1f);
            tuple.set(2, 100L);
            tuple.set(3, 50e+2);
            tuple.set(4, "something");
            tuple.set(5, new DataByteArray("something"));
 
          }
          // the middle + 1 row of the table, the smallest row
          else if (i == 0 && b == (numsBatch / 2)) {
            tuple.set(0, -100);
            tuple.set(1, -100.1f);
            tuple.set(2, -100L);
            tuple.set(3, -50e+2);
            tuple.set(4, "so");
            tuple.set(5, new DataByteArray("so"));
 
          }
 
          else {
            Float f = 1.1f;
            long l = 11;
            double d = 1.1;
            tuple.set(0, b);
            tuple.set(1, f);
            tuple.set(2, l);
            tuple.set(3, d);
            tuple.set(4, "some");
            tuple.set(5, new DataByteArray("some"));
          }
 
          // insert record
          tupRecord1.set(0, "" + b);
          tupRecord1.set(1, "" + b);
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

            tuple.set(7, 100);
            tuple.set(6, 100.1f);
            tuple.set(5, 100L);
            tuple.set(4, 50e+2);
            tuple.set(3, "something");
            tuple.set(2, new DataByteArray("something"));

          }
          // the middle +1 row of the table, the smallest row
          else if (i == 0 && b == (numsBatch / 2)) {
            tuple.set(7, -100);
            tuple.set(6, -100.1f);
            tuple.set(5, -100L);
            tuple.set(4, -50e+2);
            tuple.set(3, "so");
            tuple.set(2, new DataByteArray("so"));

          }

          else {
            Float f = 2.1f;
            long l = 12;
            double d = 2.1;
            tuple.set(7, b*2);
            tuple.set(6, f);
            tuple.set(5, l);
            tuple.set(4, d);
            tuple.set(3, "somee");
            tuple.set(2, new DataByteArray("somee"));
          }

          // insert record
          tupRecord1.set(0, "" + b);
          tupRecord1.set(1, "" + b);
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

      Object[][] table = new Object[NUMB_TABLE_ROWS][3]// three columns
     
      for (int j=0; j<NUMB_TABLE_ROWS; ++j) {
        table[j][0] = i;
        table[j][1] = new String("string" + j);
        table[j][2] = new DataByteArray("byte" + (NUMB_TABLE_ROWS - j));
        ++totalTableRows;
      }
      // Create table
      createTable(pathTables.get(i), TABLE_SCHEMA, TABLE_STORAGE, table);
     
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

        ArrayList<Object> resultRow = new ArrayList<Object>();
       
        resultRow.add(i)// int1
        resultRow.add(i)// source_table
        resultRow.add(new String("string" + j))// str1
        resultRow.add(new DataByteArray("byte" + (NUMB_TABLE_ROWS - j)))// byte1
       
        resultTable.add(resultRow);
      }
    }
   
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

        for (byte[] column : m_inputColumns) {
            value = result.getValue(column);
            if (value == null) {
                mProtoTuple.add(null);
            } else {
                mProtoTuple.add(new DataByteArray(value));
            }
        }

        Tuple newT = TupleFactory.getInstance().newTuple(mProtoTuple);
        mProtoTuple.clear();
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

        tupColl1.set(0, 3.1415926);
        tupColl1.set(1, 1.6);
        abs1[0] = 11;
        abs1[1] = 12;
        abs1[2] = 13;
        tupColl1.set(2, new DataByteArray(abs1));
        bagColl.add(tupColl1);
        tupColl2.set(0, 123.456789);
        tupColl2.set(1, 100);
        abs2[0] = 21;
        abs2[1] = 22;
        abs2[2] = 23;
        abs2[3] = 24;
        tupColl2.set(2, new DataByteArray(abs2));
        bagColl.add(tupColl2);
        tuple.set(0, bagColl);

        inserters[i].insert(new BytesWritable(("key" + i).getBytes()), tuple);
      }
View Full Code Here

Examples of org.apache.pig.data.DataByteArray

        tupColl1.set(0, 3.1415926);
        tupColl1.set(1, 1.6);
        abs1[0] = 11;
        abs1[1] = 12;
        abs1[2] = 13;
        tupColl1.set(2, new DataByteArray(abs1));
        bagColl.add(tupColl1);
        tupColl2.set(0, 123.456789);
        tupColl2.set(1, 100);
        abs2[0] = 21;
        abs2[1] = 22;
        abs2[2] = 23;
        abs2[3] = 24;
        tupColl2.set(2, new DataByteArray(abs2));
        bagColl.add(tupColl2);
        tuple.set(0, bagColl);

        inserters[i].insert(new BytesWritable(("key" + i).getBytes()), tuple);
      }
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.