Examples of MyTestClass


Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

  public void testLazyBinarySerDe() throws Throwable {
    try {
      System.out.println("test: testLazyBinarySerDe");
      int num = 1000;
      Random r = new Random(1234);
      MyTestClass rows[] = new MyTestClass[num];
      for (int i = 0; i < num; i++) {
        int randField = r.nextInt(10);
        Byte b = randField > 0 ? null : Byte.valueOf((byte) r.nextInt());
        Short s = randField > 1 ? null : Short.valueOf((short) r.nextInt());
        Integer n = randField > 2 ? null : Integer.valueOf(r.nextInt());
        Long l = randField > 3 ? null : Long.valueOf(r.nextLong());
        Float f = randField > 4 ? null : Float.valueOf(r.nextFloat());
        Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
        String st = randField > 6 ? null : TestBinarySortableSerDe
            .getRandString(r);
        MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
            .nextInt(5) - 2, r.nextInt(5) - 2);
        List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
            .getRandIntegerArray(r);
        MyTestClass t = new MyTestClass(b, s, n, l, f, d, st, is, li);
        rows[i] = t;
      }

      StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory
          .getReflectionObjectInspector(MyTestClass.class,
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
          .nextInt(5) - 2, r.nextInt(5) - 2);
      List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
          .getRandIntegerArray(r);
      byte[] ba = TestBinarySortableSerDe.getRandBA(r, itest);
      MyTestClass input = new MyTestClass(b, s, n, l, f, d, st, is, li, ba);
      BytesWritable bw = (BytesWritable) serde1.serialize(input, rowOI1);
      Object output = serde2.deserialize(bw);

      if (0 != compareDiffSizedStructs(input, rowOI1, output, serdeOI2)) {
        System.out.println("structs      = "
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
          .nextInt(5) - 2, r.nextInt(5) - 2);
      List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
          .getRandIntegerArray(r);
      byte[] ba = TestBinarySortableSerDe.getRandBA(r, itest);
      MyTestClass input = new MyTestClass(b, s, n, l, f, d, st, is, li,ba);
      BytesWritable bw = (BytesWritable) serde1.serialize(input, rowOI1);
      Object output = serde2.deserialize(bw);

      if (0 != compareDiffSizedStructs(input, rowOI1, output, serdeOI2)) {
        System.out.println("structs      = "
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      System.out.println("Beginning Test TestLazyBinarySerDe:");

      // generate the data
      int num = 1000;
      Random r = new Random(1234);
      MyTestClass rows[] = new MyTestClass[num];
      for (int i = 0; i < num; i++) {
        int randField = r.nextInt(10);
        Byte b = randField > 0 ? null : Byte.valueOf((byte) r.nextInt());
        Short s = randField > 1 ? null : Short.valueOf((short) r.nextInt());
        Integer n = randField > 2 ? null : Integer.valueOf(r.nextInt());
        Long l = randField > 3 ? null : Long.valueOf(r.nextLong());
        Float f = randField > 4 ? null : Float.valueOf(r.nextFloat());
        Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
        String st = randField > 6 ? null : TestBinarySortableSerDe
            .getRandString(r);
        MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
            .nextInt(5) - 2, r.nextInt(5) - 2);
        List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
            .getRandIntegerArray(r);
        byte[] ba = TestBinarySortableSerDe.getRandBA(r, i);
        MyTestClass t = new MyTestClass(b, s, n, l, f, d, st, is, li, ba);
        rows[i] = t;
      }

      StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory
          .getReflectionObjectInspector(MyTestClass.class,
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

  public void testLazyBinarySerDe() throws Throwable {
    try {
      System.out.println("test: testLazyBinarySerDe");
      int num = 1000;
      Random r = new Random(1234);
      MyTestClass rows[] = new MyTestClass[num];
      for (int i = 0; i < num; i++) {
        int randField = r.nextInt(10);
        Byte b = randField > 0 ? null : Byte.valueOf((byte) r.nextInt());
        Short s = randField > 1 ? null : Short.valueOf((short) r.nextInt());
        Integer n = randField > 2 ? null : Integer.valueOf(r.nextInt());
        Long l = randField > 3 ? null : Long.valueOf(r.nextLong());
        Float f = randField > 4 ? null : Float.valueOf(r.nextFloat());
        Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
        String st = randField > 6 ? null : TestBinarySortableSerDe
            .getRandString(r);
        MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
            .nextInt(5) - 2, r.nextInt(5) - 2);
        List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
            .getRandIntegerArray(r);
        byte[] ba = TestBinarySortableSerDe.getRandBA(r, i);
        MyTestClass t = new MyTestClass(b, s, n, l, f, d, st, is, li,ba);
        rows[i] = t;
      }

      StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory
          .getReflectionObjectInspector(MyTestClass.class,
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      Double d  = randField > 5 ? null : Double.valueOf(r.nextDouble());
      String st = randField > 6 ? null : TestBinarySortableSerDe.getRandString(r);
      MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r.nextInt(5)-2, r.nextInt(5)-2);
      List<Integer> li = randField > 8 ? null: TestBinarySortableSerDe.getRandIntegerArray(r);
     
      MyTestClass input = new MyTestClass(b,s,n,l,f,d,st,is,li);  
      BytesWritable bw = (BytesWritable) serde1.serialize(input, rowOI1);
      Object output = serde2.deserialize(bw);   
     
      if(0 != compareDiffSizedStructs(input, rowOI1, output, serdeOI2)) {
        System.out.println("structs      = " + SerDeUtils.getJSONString(input, rowOI1));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      Double d  = randField > 5 ? null : Double.valueOf(r.nextDouble());
      String st = randField > 6 ? null : TestBinarySortableSerDe.getRandString(r);
      MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r.nextInt(5)-2, r.nextInt(5)-2);
      List<Integer> li = randField > 8 ? null: TestBinarySortableSerDe.getRandIntegerArray(r);
     
      MyTestClass input = new MyTestClass(b,s,n,l,f,d,st,is,li);  
      BytesWritable bw = (BytesWritable) serde1.serialize(input, rowOI1);
      Object output = serde2.deserialize(bw);   
     
      if (0 != compareDiffSizedStructs(input, rowOI1, output, serdeOI2)) {
        System.out.println("structs      = " + SerDeUtils.getJSONString(input, rowOI1));
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      System.out.println("Beginning Test TestLazyBinarySerDe:");
     
      // generate the data
      int num = 1000;
      Random r = new Random(1234);
      MyTestClass rows[] = new MyTestClass[num];
      for (int i=0; i<num; i++) {
        int randField = r.nextInt(10);
        Byte b    = randField > 0 ? null : Byte.valueOf((byte)r.nextInt());
        Short s   = randField > 1 ? null : Short.valueOf((short)r.nextInt());
        Integer n = randField > 2 ? null : Integer.valueOf(r.nextInt());
        Long l    = randField > 3 ? null : Long.valueOf(r.nextLong());
        Float f   = randField > 4 ? null : Float.valueOf(r.nextFloat());
        Double d  = randField > 5 ? null : Double.valueOf(r.nextDouble());
        String st = randField > 6 ? null : TestBinarySortableSerDe.getRandString(r);
        MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r.nextInt(5)-2, r.nextInt(5)-2);
        List<Integer> li = randField > 8 ? null: TestBinarySortableSerDe.getRandIntegerArray(r);
        MyTestClass t = new MyTestClass(b,s,n,l,f,d,st,is,li);
        rows[i] = t;
      }
     
      StructObjectInspector rowOI = (StructObjectInspector)ObjectInspectorFactory
      .getReflectionObjectInspector(MyTestClass.class,
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

  public void testLazyBinarySerDe() throws Throwable {
    try {
      System.out.println("test: testLazyBinarySerDe");
      int num = 1000;
      Random r = new Random(1234);
      MyTestClass rows[] = new MyTestClass[num];
      for (int i = 0; i < num; i++) {
        int randField = r.nextInt(10);
        Byte b = randField > 0 ? null : Byte.valueOf((byte) r.nextInt());
        Short s = randField > 1 ? null : Short.valueOf((short) r.nextInt());
        Integer n = randField > 2 ? null : Integer.valueOf(r.nextInt());
        Long l = randField > 3 ? null : Long.valueOf(r.nextLong());
        Float f = randField > 4 ? null : Float.valueOf(r.nextFloat());
        Double d = randField > 5 ? null : Double.valueOf(r.nextDouble());
        String st = randField > 6 ? null : TestBinarySortableSerDe
            .getRandString(r);
        MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
            .nextInt(5) - 2, r.nextInt(5) - 2);
        List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
            .getRandIntegerArray(r);
        ByteArrayRef ba = TestBinarySortableSerDe.getRandBA(r, i);
        MyTestClass t = new MyTestClass(b, s, n, l, f, d, st, is, li,ba);
        rows[i] = t;
      }

      StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory
          .getReflectionObjectInspector(MyTestClass.class,
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.binarysortable.MyTestClass

      MyTestInnerStruct is = randField > 7 ? null : new MyTestInnerStruct(r
          .nextInt(5) - 2, r.nextInt(5) - 2);
      List<Integer> li = randField > 8 ? null : TestBinarySortableSerDe
          .getRandIntegerArray(r);
      ByteArrayRef ba = TestBinarySortableSerDe.getRandBA(r, itest);
      MyTestClass input = new MyTestClass(b, s, n, l, f, d, st, is, li, ba);
      BytesWritable bw = (BytesWritable) serde1.serialize(input, rowOI1);
      Object output = serde2.deserialize(bw);

      if (0 != compareDiffSizedStructs(input, rowOI1, output, serdeOI2)) {
        System.out.println("structs      = "
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.