Examples of ByteArrayRef


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

       
        // Keys are always primitive
        LazyPrimitive<?, ?> key = LazyFactory.createLazyPrimitiveClass(
            (PrimitiveObjectInspector)
            ((MapObjectInspector) getInspector()).getMapKeyObjectInspector());
        ByteArrayRef keyRef = new ByteArrayRef();
        keyRef.setData(columnKey);
        key.init(
          keyRef, columnFamily.length, columnKey.length - columnFamily.length);
       
        // Value
        LazyObject value = LazyFactory.createLazyObject(
          ((MapObjectInspector) getInspector()).getMapValueObjectInspector());
        ByteArrayRef valueRef = new ByteArrayRef();
        valueRef.setData(columnValue);
        value.init(valueRef, 0, columnValue.length);
       
        // Put it into the map
        cachedMap.put(key.getObject(), value.getObject());
      }
View Full Code Here

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

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

   * 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

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

    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

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

  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

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

  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

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

  @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

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

    return ba;
  }

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

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

  @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

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

  @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
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.