Examples of ByteArrayRef


Examples of org.activiti.engine.impl.persistence.entity.ByteArrayRef

  }
 
  @Override
  public ByteArrayRef getResult(ResultSet rs, String columnName) throws SQLException {
    String id = rs.getString(columnName);
    return new ByteArrayRef(id);
  }
View Full Code Here

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

    LazyObject<?> [] fields = getFields();
    boolean [] fieldsInited = getFieldInited();

    if (!fieldsInited[fieldID]) {
      ByteArrayRef ref = null;
      ColumnMapping colMap = columnsMapping.get(fieldID);

      if (colMap.hbaseRowKey) {
        ref = new ByteArrayRef();
        ref.setData(result.getRow());
      } else {
        if (colMap.qualifierName == null) {
          // it is a column family
          // primitive type for Map<Key, Value> can be stored in binary format. Pass in the
          // qualifier prefix to cherry pick the qualifiers that match the prefix instead of picking
          // up everything
          ((LazyHBaseCellMap) fields[fieldID]).init(
              result, colMap.familyNameBytes, colMap.binaryStorage, colMap.qualifierPrefixBytes);
        } else {
          // it is a column i.e. a column-family with column-qualifier
          byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);

          if (res == null) {
            return null;
          } else {
            ref = new ByteArrayRef();
            ref.setData(res);
          }
        }
      }

      if (ref != null) {
        fields[fieldID].init(ref, 0, ref.getData().length);
      }
    }

    // Has to be set last because of HIVE-3179: NULL fields would not work otherwise
    fieldsInited[fieldID] = true;
View Full Code Here

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

    if (c.isInstance(new Timestamp(0))){
      return javaObjectOverHead + javaSizePrimitiveType;
    }

    if (c.isInstance(new String()) || c.isInstance(new ByteArrayRef())) {
      if (aggrPositions[pos] == null) {
        aggrPositions[pos] = new ArrayList<Field>();
      }
      aggrPositions[pos].add(f);
      return javaObjectOverHead;
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

    boolean inited;
    boolean fieldSkipped;

    public FieldInfo(LazyObject lazyObject, boolean fieldSkipped) {
      field = lazyObject;
      cachedByteArrayRef = new ByteArrayRef();
      if (fieldSkipped) {
        this.fieldSkipped = true;
        inited = true;
      } else {
        inited = false;
View Full Code Here

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

        notSkippedColumnIDs.add(i);
    }
   
    for (int i = 0; i < num; i++) {
      fields[i] = LazyFactory.createLazyObject(fieldRefs.get(i).getFieldObjectInspector());
      cachedByteArrayRef[i] = new ByteArrayRef();
      if(!notSkippedColumnIDs.contains(i)){
        fieldSkipped[i] = true;
        inited[i] = true;
      } else
        inited[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.getLength() == 0) {
        return null;
View Full Code Here

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

   * @throws Throwable
   */
  public void testLazyBinaryObjectInspector() throws Throwable {

    //create input ByteArrayRef
    ByteArrayRef inpBARef = new ByteArrayRef();
    inpBARef.setData(inpBArray);

    AbstractPrimitiveLazyObjectInspector<?> binInspector = LazyPrimitiveObjectInspectorFactory
    .getLazyObjectInspector(PrimitiveCategory.BINARY, false, (byte)0);

    //create LazyBinary initialed with inputBA
View Full Code Here

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

    if (c.isInstance(new Timestamp(0))){
      return javaObjectOverHead + javaSizePrimitiveType;
    }

    if (c.isInstance(new String()) || c.isInstance(new ByteArrayRef())) {
      int idx = 0;
      varLenFields v = null;
      for (idx = 0; idx < aggrPositions.size(); idx++) {
        v = aggrPositions.get(idx);
        if (v.getAggrPos() == pos) {
View Full Code Here

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

   */
  private Object uncheckedGetField(int fieldID) {
    if (!getFieldInited()[fieldID]) {
      getFieldInited()[fieldID] = true;
     
      ByteArrayRef ref = null;
     
      String columnName = hbaseColumns.get(fieldID);
      if (columnName.equals(HBaseSerDe.HBASE_KEY_COL)) {
        ref = new ByteArrayRef();
        ref.setData(rowResult.getRow());
      } else {
        if (columnName.endsWith(":")) {
          // it is a column family
          ((LazyHBaseCellMap) getFields()[fieldID]).init(
            rowResult, columnName);
        } else {
          // it is a column
          if (rowResult.containsKey(columnName)) {
            ref = new ByteArrayRef();
            ref.setData(rowResult.get(columnName).getValue());
          } else {
            return null;
          }
        }
      }
      if (ref != null) {
        getFields()[fieldID].init(ref, 0, ref.getData().length);
      }
    }
    return getFields()[fieldID].getObject();
  }
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.