Package org.apache.hadoop.hive.serde2.lazy

Examples of org.apache.hadoop.hive.serde2.lazy.ByteArrayRef


    fields = new LazyObject[num];
    cachedByteArrayRef = new ByteArrayRef[num];
    fieldIsNull = new boolean[num];
    for (int i = 0; i < num; i++) {
      fields[i] = LazyFactory.createLazyObject(fieldRefs.get(i).getFieldObjectInspector());
      cachedByteArrayRef[i] = new ByteArrayRef();
      fieldIsNull[i] = false;
    }
  }
View Full Code Here


   * Deserialize a table record to a lazybinary struct.
   */
  @Override
  public Object deserialize(Writable field) throws SerDeException {
    if (byteArrayRef == null) {
      byteArrayRef = new ByteArrayRef();
    }
    if (field instanceof BytesWritable) {
      BytesWritable b = (BytesWritable)field;
      if(b.getSize()==0)
        return null;
View Full Code Here

    public BinaryConverter(PrimitiveObjectInspector inputOI,
        SettableBinaryObjectInspector outputOI) {
      this.inputOI = inputOI;
      this.outputOI = outputOI;
      ByteArrayRef ba = new ByteArrayRef();
      ba.setData(new byte[]{});
      r = outputOI.create(ba);
    }
View Full Code Here

  public ByteArrayRef copyObject(Object o) {
    if (null == o){
      return null;
    }

    ByteArrayRef ba = new ByteArrayRef();
    byte[] incoming = ((ByteArrayRef)o).getData();
    byte[] outgoing = new byte[incoming.length];
    System.arraycopy(incoming, 0, outgoing, 0, incoming.length);
    ba.setData(outgoing);
    return ba;
  }
View Full Code Here

  public ByteArrayRef getPrimitiveJavaObject(Object o) {
    return (ByteArrayRef)o;
  }
  @Override
  public ByteArrayRef set(Object o, ByteArrayRef bb) {
    ByteArrayRef ba = (ByteArrayRef)o;
    ba.setData(bb.getData());
    return ba;
  }
View Full Code Here

  @Override
  public ByteArrayRef set(Object o, BytesWritable bw) {
    if (null == bw){
      return null;
    }
    ByteArrayRef ba = (ByteArrayRef)o;
    ba.setData(bw.getBytes());
    return ba;
  }
View Full Code Here

    return ba;
  }

  @Override
  public ByteArrayRef create(ByteArrayRef bb) {
    ByteArrayRef ba = new ByteArrayRef();
    ba.setData(bb.getData());
    return ba;
  }
View Full Code Here

  @Override
  public ByteArrayRef create(BytesWritable bw) {
    if(null == bw){
      return null;
    }
    ByteArrayRef ba = new ByteArrayRef();
    ba.setData(bw.getBytes());
    return ba;
  }
View Full Code Here

  @Override
  public ByteArrayRef getPrimitiveJavaObject(Object o) {
    if (null == o) {
      return null;
    }
    ByteArrayRef ba = new ByteArrayRef();
    ba.setData(((LazyBinary) o).getWritableObject().getBytes());
    return ba;
  }
View Full Code Here

    outerStruct.mInt = 3;
    outerStruct.mLong = 4l;
    outerStruct.mFloat = 5.01f;
    outerStruct.mDouble = 6.001d;
    outerStruct.mString = "seven";
    ByteArrayRef ba = new ByteArrayRef();
    ba.setData(new byte[]{'2'});
    outerStruct.mBA =  ba;
    InnerStruct is1 = new InnerStruct(8, 9l);
    InnerStruct is2 = new InnerStruct(10, 11l);
    outerStruct.mArray = new ArrayList<InnerStruct>(2);
    outerStruct.mArray.add(is1);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.lazy.ByteArrayRef

Copyright © 2018 www.massapicom. 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.