Package org.apache.hadoop.hive.serde2.ByteStream

Examples of org.apache.hadoop.hive.serde2.ByteStream.Output


  }

  private static byte[] serializeRowCommon(Output byteStream,
      Object[] fieldData, List<ObjectInspector> fieldOis) throws SerDeException {
    if (byteStream == null) {
      byteStream = new Output();
    } else {
      byteStream.reset();
    }
    LazyBinarySerDe.serializeStruct(byteStream, fieldData, fieldOis);
    return Arrays.copyOf(byteStream.getData(), byteStream.getCount());
View Full Code Here


    // We only check if we can use optimized keys here; that is ok because we don't
    // create optimized keys in MapJoin if hash map doesn't have optimized keys.
    if (!HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEMAPJOINUSEOPTIMIZEDKEYS)) {
      lastKey = new MapJoinKeyObject();
    }
    Output output = new Output(); // Reusable output for serialization.
    for (int pos = 0; pos < mapJoinTables.length; pos++) {
      if (pos == desc.getPosBigTable()) {
        continue;
      }
View Full Code Here

    // This key evaluator translates from the vectorized VectorHashKeyWrapper format
    // into the row-mode MapJoinKey
    keyEvaluator = new MapJoinKeyEvaluator() {
      private MapJoinKey key = null;
      private final Output output = new Output();

      public MapJoinKeyEvaluator init() {
        return this;
      }
View Full Code Here

      List<ObjectInspector> fois = new ArrayList<ObjectInspector>(fields.size());
      for (int i = 0; i < fields.size(); i++) {
        data[i] = soi.getStructFieldData(o, fields.get(i));
        fois.add(fields.get(i).getFieldObjectInspector());
      }
      Output output = new Output();
      BinarySortableSerDe.serializeStruct(output, data, fois, new boolean[fields.size()]);
      hasTag = (output.getLength() != b.getLength());
      if (hasTag) {
        LOG.error("Tag found in keys and will be removed. This should not happen.");
        if (output.getLength() != (b.getLength() - 1)) {
          throw new SerDeException(
              "Unexpected tag: " + b.getLength() + " reserialized to " + output.getLength());
        }
      }
    }
View Full Code Here

    private final ReusableRowContainer currentValue;
    private final Output output;

    public GetAdaptor() {
      currentValue = new ReusableRowContainer();
      output = new Output();
    }
View Full Code Here

   * @param byteStream Output to reuse. Can be null, in that case a new one would be created.
   */
  public static Output serializeRow(Output byteStream, Object[] fieldData,
      List<ObjectInspector> fieldOis, boolean[] sortableSortOrders) throws HiveException {
    if (byteStream == null) {
      byteStream = new Output();
    } else {
      byteStream.reset();
    }
    try {
      if (fieldData.length == 0) {
View Full Code Here

    // This key evaluator translates from the vectorized VectorHashKeyWrapper format
    // into the row-mode MapJoinKey
    keyEvaluator = new MapJoinKeyEvaluator() {
      private MapJoinKey key = null;
      private final Output output = new Output();

      public MapJoinKeyEvaluator init() {
        return this;
      }
View Full Code Here

    // We only check if we can use optimized keys here; that is ok because we don't
    // create optimized keys in MapJoin if hash map doesn't have optimized keys.
    if (!HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVEMAPJOINUSEOPTIMIZEDKEYS)) {
      lastKey = new MapJoinKeyObject();
    }
    Output output = new Output(); // Reusable output for serialization.
    for (int pos = 0; pos < mapJoinTables.length; pos++) {
      if (pos == desc.getPosBigTable()) {
        continue;
      }
View Full Code Here

    return reader.loadIndeces(rowIndexEntries, updatedStartIndex);
  }

  @Override
  public Object next(Object previous) throws IOException {
    ByteWritable result = null;
    if (valuePresent) {
      if (previous == null) {
        result = new ByteWritable();
      } else {
        result = (ByteWritable) previous;
      }
      result.set(reader.next());
    }
    return result;
  }
View Full Code Here

    return o == null ? null : new OrcLazyByte((OrcLazyByte) o);
  }

  @Override
  public Object getPrimitiveJavaObject(Object o) {
    ByteWritable writable = getPrimitiveWritableObject(o);
    return writable == null ? null : Byte.valueOf(writable.get());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.ByteStream.Output

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.