Examples of IntString


Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        TIOStreamTransport transport = new TIOStreamTransport(out);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);

        IntString intString = new IntString(1, "one", 1);
        intString.write(protocol);
        BytesWritable bytesWritable = new BytesWritable(out.toByteArray());

        intStringSeq = new Path(TEST_DATA_DIR + "/data/intString.seq");
        LOG.info("Creating data file: " + intStringSeq);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 0) {
                seqFileWriter.append(NullWritable.get(), new BytesWritable("bad record".getBytes()));
            } else {
                out.reset();
                IntString intString = new IntString(i, Integer.toString(i), i);
                intString.write(protocol);
                BytesWritable bytesWritable = new BytesWritable(out.toByteArray());
                seqFileWriter.append(NullWritable.get(), bytesWritable);
            }
        }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

    for (int i = 1; i <= 100; i++) {
      if (i % 10 == 0) {
        seqFileWriter.append(NullWritable.get(), new BytesWritable("bad record".getBytes()));
      } else {
        out.reset();
        IntString intString = new IntString(i, Integer.toString(i), i);
        intString.write(protocol);
        BytesWritable bytesWritable = new BytesWritable(out.toByteArray());
        seqFileWriter.append(NullWritable.get(), bytesWritable);
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

    for (int i = 1; i <= 100; i++) {
      if (i % 10 == 0) {
        seqFileWriter.append(NullWritable.get(), new BytesWritable("bad record".getBytes()));
      } else {
        out.reset();
        IntString intString = new IntString(i, Integer.toString(i), i);
        intString.write(protocol);
        BytesWritable bytesWritable = new BytesWritable(out.toByteArray());
        seqFileWriter.append(NullWritable.get(), bytesWritable);
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

      ArrayList<String> slist = new ArrayList<String>();
      slist.add("" + i * 10);
      slist.add("" + i * 100);
      slist.add("" + i * 1000);
      ArrayList<IntString> islist = new ArrayList<IntString>();
      islist.add(new IntString(i * i, "" + i * i * i, i));
      HashMap<String, String> hash = new HashMap<String, String>();
      hash.put("key_" + i, "value_" + i);

      Complex complex = new Complex(rand.nextInt(), "record_"
          + (new Integer(i)).toString(), alist, slist, islist, hash);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    TIOStreamTransport transport = new TIOStreamTransport(out);
    TBinaryProtocol protocol = new TBinaryProtocol(transport);

    IntString intString = new IntString(1, "one", 1);
    intString.write(protocol);
    BytesWritable bytesWritable = new BytesWritable(out.toByteArray());

    intStringSeq = new Path(TEST_DATA_DIR + "/data/intString.seq");
    LOG.info("Creating data file: " + intStringSeq);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

      ArrayList<String> slist = new ArrayList<String>();
      slist.add("" + i * 10);
      slist.add("" + i * 100);
      slist.add("" + i * 1000);
      ArrayList<IntString> islist = new ArrayList<IntString>();
      islist.add(new IntString(i * i, "" + i * i * i, i));
      HashMap<String, String> hash = new HashMap<String, String>();
      hash.put("key_" + i, "value_" + i);
      Map<String, Map<String, Map<String,PropValueUnion>>> unionMap = new HashMap<String, Map<String, Map<String,PropValueUnion>>>();
      Map<String, Map<String, PropValueUnion>> erMap = new HashMap<String, Map<String, PropValueUnion>>();
      Map<String, PropValueUnion> attrMap = new HashMap<String, PropValueUnion>();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

      for (int i = 0; i < fields.size(); i++) {
        assertNull(soi.getStructFieldData(null, fields.get(i)));
      }

      // real object
      IntString s1 = new IntString();
      s1.setMyint(1);
      s1.setMyString("test");
      s1.setUnderscore_int(2);

      Set<IntString> set1 = new HashSet<IntString>();
      set1.add(s1);

      SetIntString s = new SetIntString();
      s.setSIntString(set1);
      s.setAString("setString");

      assertEquals(set1, soi.getStructFieldData(s, fields.get(0)));
      assertEquals("setString", soi.getStructFieldData(s, fields.get(1)));

      // sub fields
      assertEquals(
          ObjectInspectorFactory
          .getStandardListObjectInspector(ObjectInspectorFactory
              .getReflectionObjectInspector(IntString.class,
                  ObjectInspectorFactory.ObjectInspectorOptions.THRIFT)),
          fields.get(0).getFieldObjectInspector());
      assertEquals(PrimitiveObjectInspectorFactory.javaStringObjectInspector,
          fields.get(1).getFieldObjectInspector());

      // compare set fields
      ListObjectInspector loi = (ListObjectInspector) fields.get(0).getFieldObjectInspector();
      assertEquals(1, loi.getListLength(set1));
      List<IntString> list = (List<IntString>) loi.getList(set1);
      assertEquals(1, list.size());
      s1 = (IntString) loi.getListElement(list, 0);
      assertEquals(1, s1.getMyint());
      assertEquals("test", s1.getMyString());
      assertEquals(2, s1.getUnderscore_int());
    } catch (Throwable e) {
      e.printStackTrace();
      throw e;
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.test.IntString

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    TIOStreamTransport transport = new TIOStreamTransport(out);
    TBinaryProtocol protocol = new TBinaryProtocol(transport);

    IntString intString = new IntString(1, "one", 1);
    intString.write(protocol);
    BytesWritable bytesWritable = new BytesWritable(out.toByteArray());

    intStringSeq = new Path(TEST_DATA_DIR + "/data/intString.seq");
    LOG.info("Creating data file: " + intStringSeq);
View Full Code Here

Examples of org.redline_rpm.IntString

    }

    public Map< String, IntString> getDepends() {
        Map< String, IntString> dependsMap = new HashMap< String, IntString>();
        for (Depends d : this.depends) {
            dependsMap.put(d.getName(), new IntString(d.getComparison(), d.getVersion()));
        }
        return dependsMap;
    }
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.