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

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


    boolean fieldSkipped;
    ObjectInspector objectInspector;

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


  public LazyObject<? extends ObjectInspector> toLazyObject(int fieldID, byte[] bytes) {
    ObjectInspector fieldOI = oi.getAllStructFieldRefs().get(fieldID).getFieldObjectInspector();

    LazyObject<? extends ObjectInspector> lazyObject = LazyFactory.createLazyObject(fieldOI);

    ByteArrayRef ref = new ByteArrayRef();

    ref.setData(bytes);

    // initialize the lazy object
    lazyObject.init(ref, 0, ref.getData().length);

    return lazyObject;
  }
View Full Code Here

    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    String cf = "cf";
    byte[] cfBytes = cf.getBytes();
    ByteArrayRef byteRef = new ByteArrayRef();

    Mutation m = new Mutation("row1");

    // string
    String stringValue = "string";
    baos.reset();
    JavaStringObjectInspector stringOI = (JavaStringObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.STRING_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, stringOI.create(stringValue), stringOI, false, (byte) 0,
        null);
    m.put(cfBytes, "string".getBytes(), baos.toByteArray());

    // boolean
    boolean booleanValue = true;
    baos.reset();
    JavaBooleanObjectInspector booleanOI = (JavaBooleanObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.BOOLEAN_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, booleanOI.create(booleanValue), booleanOI, false, (byte) 0,
        null);
    m.put(cfBytes, "boolean".getBytes(), baos.toByteArray());

    // tinyint
    byte tinyintValue = -127;
    baos.reset();
    JavaByteObjectInspector byteOI = (JavaByteObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.TINYINT_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, tinyintValue, byteOI, false, (byte) 0, null);
    m.put(cfBytes, "tinyint".getBytes(), baos.toByteArray());

    // smallint
    short smallintValue = Short.MAX_VALUE;
    baos.reset();
    JavaShortObjectInspector shortOI = (JavaShortObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.SMALLINT_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, smallintValue, shortOI, false, (byte) 0, null);
    m.put(cfBytes, "smallint".getBytes(), baos.toByteArray());

    // int
    int intValue = Integer.MAX_VALUE;
    baos.reset();
    JavaIntObjectInspector intOI = (JavaIntObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.INT_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, intValue, intOI, false, (byte) 0, null);
    m.put(cfBytes, "int".getBytes(), baos.toByteArray());

    // bigint
    long bigintValue = Long.MAX_VALUE;
    baos.reset();
    JavaLongObjectInspector longOI = (JavaLongObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.BIGINT_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, bigintValue, longOI, false, (byte) 0, null);
    m.put(cfBytes, "bigint".getBytes(), baos.toByteArray());

    // float
    float floatValue = Float.MAX_VALUE;
    baos.reset();
    JavaFloatObjectInspector floatOI = (JavaFloatObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.FLOAT_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, floatValue, floatOI, false, (byte) 0, null);
    m.put(cfBytes, "float".getBytes(), baos.toByteArray());

    // double
    double doubleValue = Double.MAX_VALUE;
    baos.reset();
    JavaDoubleObjectInspector doubleOI = (JavaDoubleObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.DOUBLE_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, doubleValue, doubleOI, false, (byte) 0, null);
    m.put(cfBytes, "double".getBytes(), baos.toByteArray());

    // decimal
    HiveDecimal decimalValue = HiveDecimal.create("1.23");
    baos.reset();
    JavaHiveDecimalObjectInspector decimalOI = (JavaHiveDecimalObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new DecimalTypeInfo(5, 2));
    LazyUtils.writePrimitiveUTF8(baos, decimalOI.create(decimalValue), decimalOI, false, (byte) 0,
        null);
    m.put(cfBytes, "decimal".getBytes(), baos.toByteArray());

    // date
    Date now = new Date(System.currentTimeMillis());
    DateWritable dateWritable = new DateWritable(now);
    Date dateValue = dateWritable.get();
    baos.reset();
    JavaDateObjectInspector dateOI = (JavaDateObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.DATE_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, dateOI.create(dateValue), dateOI, false, (byte) 0, null);
    m.put(cfBytes, "date".getBytes(), baos.toByteArray());

    // timestamp
    Timestamp timestampValue = new Timestamp(now.getTime());
    baos.reset();
    JavaTimestampObjectInspector timestampOI = (JavaTimestampObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.TIMESTAMP_TYPE_NAME));
    LazyUtils.writePrimitiveUTF8(baos, timestampOI.create(timestampValue), timestampOI, false,
        (byte) 0, null);
    m.put(cfBytes, "timestamp".getBytes(), baos.toByteArray());

    // char
    baos.reset();
    HiveChar charValue = new HiveChar("char", 4);
    JavaHiveCharObjectInspector charOI = (JavaHiveCharObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new CharTypeInfo(4));
    LazyUtils.writePrimitiveUTF8(baos, charOI.create(charValue), charOI, false, (byte) 0, null);
    m.put(cfBytes, "char".getBytes(), baos.toByteArray());

    // varchar
    baos.reset();
    HiveVarchar varcharValue = new HiveVarchar("varchar", 7);
    JavaHiveVarcharObjectInspector varcharOI = (JavaHiveVarcharObjectInspector) PrimitiveObjectInspectorFactory
        .getPrimitiveJavaObjectInspector(new VarcharTypeInfo(7));
    LazyUtils.writePrimitiveUTF8(baos, varcharOI.create(varcharValue), varcharOI, false, (byte) 0,
        null);
    m.put(cfBytes, "varchar".getBytes(), baos.toByteArray());

    writer.addMutation(m);

    writer.close();

    for (Entry<Key,Value> e : conn.createScanner(tableName, new Authorizations())) {
      System.out.println(e);
    }

    // Create the RecordReader
    FileInputFormat.addInputPath(conf, new Path("unused"));
    InputSplit[] splits = inputformat.getSplits(conf, 0);
    assertEquals(splits.length, 1);
    RecordReader<Text,AccumuloHiveRow> reader = inputformat.getRecordReader(splits[0], conf, null);

    Text key = reader.createKey();
    AccumuloHiveRow value = reader.createValue();

    reader.next(key, value);

    Assert.assertEquals(13, value.getTuples().size());

    // string
    Text cfText = new Text(cf), cqHolder = new Text();
    cqHolder.set("string");
    byte[] valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyStringObjectInspector lazyStringOI = LazyPrimitiveObjectInspectorFactory
        .getLazyStringObjectInspector(false, (byte) 0);
    LazyString lazyString = (LazyString) LazyFactory.createLazyObject(lazyStringOI);
    lazyString.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(new Text(stringValue), lazyString.getWritableObject());

    // boolean
    cqHolder.set("boolean");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyBooleanObjectInspector lazyBooleanOI = (LazyBooleanObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.BOOLEAN_TYPE_NAME));
    LazyBoolean lazyBoolean = (LazyBoolean) LazyFactory.createLazyObject(lazyBooleanOI);
    lazyBoolean.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(booleanValue, lazyBoolean.getWritableObject().get());

    // tinyint
    cqHolder.set("tinyint");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyByteObjectInspector lazyByteOI = (LazyByteObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.TINYINT_TYPE_NAME));
    LazyByte lazyByte = (LazyByte) LazyFactory.createLazyObject(lazyByteOI);
    lazyByte.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(tinyintValue, lazyByte.getWritableObject().get());

    // smallint
    cqHolder.set("smallint");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyShortObjectInspector lazyShortOI = (LazyShortObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.SMALLINT_TYPE_NAME));
    LazyShort lazyShort = (LazyShort) LazyFactory.createLazyObject(lazyShortOI);
    lazyShort.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(smallintValue, lazyShort.getWritableObject().get());

    // int
    cqHolder.set("int");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyIntObjectInspector lazyIntOI = (LazyIntObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory.getPrimitiveTypeInfo(serdeConstants.INT_TYPE_NAME));
    LazyInteger lazyInt = (LazyInteger) LazyFactory.createLazyObject(lazyIntOI);
    lazyInt.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(intValue, lazyInt.getWritableObject().get());

    // bigint
    cqHolder.set("bigint");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyLongObjectInspector lazyLongOI = (LazyLongObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.BIGINT_TYPE_NAME));
    LazyLong lazyLong = (LazyLong) LazyFactory.createLazyObject(lazyLongOI);
    lazyLong.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(bigintValue, lazyLong.getWritableObject().get());

    // float
    cqHolder.set("float");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyFloatObjectInspector lazyFloatOI = (LazyFloatObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.FLOAT_TYPE_NAME));
    LazyFloat lazyFloat = (LazyFloat) LazyFactory.createLazyObject(lazyFloatOI);
    lazyFloat.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(floatValue, lazyFloat.getWritableObject().get(), 0);

    // double
    cqHolder.set("double");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyDoubleObjectInspector lazyDoubleOI = (LazyDoubleObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.DOUBLE_TYPE_NAME));
    LazyDouble lazyDouble = (LazyDouble) LazyFactory.createLazyObject(lazyDoubleOI);
    lazyDouble.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(doubleValue, lazyDouble.getWritableObject().get(), 0);

    // decimal
    cqHolder.set("decimal");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyHiveDecimalObjectInspector lazyDecimalOI = (LazyHiveDecimalObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(new DecimalTypeInfo(5, 2));
    LazyHiveDecimal lazyDecimal = (LazyHiveDecimal) LazyFactory.createLazyObject(lazyDecimalOI);
    lazyDecimal.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(decimalValue, lazyDecimal.getWritableObject().getHiveDecimal());

    // date
    cqHolder.set("date");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyDateObjectInspector lazyDateOI = (LazyDateObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory.getPrimitiveTypeInfo(serdeConstants.DATE_TYPE_NAME));
    LazyDate lazyDate = (LazyDate) LazyFactory.createLazyObject(lazyDateOI);
    lazyDate.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(dateValue, lazyDate.getWritableObject().get());

    // timestamp
    cqHolder.set("timestamp");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyTimestampObjectInspector lazyTimestampOI = (LazyTimestampObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(TypeInfoFactory
            .getPrimitiveTypeInfo(serdeConstants.TIMESTAMP_TYPE_NAME));
    LazyTimestamp lazyTimestamp = (LazyTimestamp) LazyFactory.createLazyObject(lazyTimestampOI);
    lazyTimestamp.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(timestampValue, lazyTimestamp.getWritableObject().getTimestamp());

    // char
    cqHolder.set("char");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyHiveCharObjectInspector lazyCharOI = (LazyHiveCharObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(new CharTypeInfo(4));
    LazyHiveChar lazyChar = (LazyHiveChar) LazyFactory.createLazyObject(lazyCharOI);
    lazyChar.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(charValue, lazyChar.getWritableObject().getHiveChar());

    // varchar
    cqHolder.set("varchar");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyHiveVarcharObjectInspector lazyVarcharOI = (LazyHiveVarcharObjectInspector) LazyPrimitiveObjectInspectorFactory
        .getLazyObjectInspector(new VarcharTypeInfo(7));
    LazyHiveVarchar lazyVarchar = (LazyHiveVarchar) LazyFactory.createLazyObject(lazyVarcharOI);
    lazyVarchar.init(byteRef, 0, valueBytes.length);
View Full Code Here

    LazyObjectBase[] fields = getFields();
    boolean [] fieldsInited = getFieldInited();

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

      if (colMap.hbaseRowKey) {
        ref = new ByteArrayRef();
        ref.setData(result.getRow());
      } else if (colMap.hbaseTimestamp) {
        long timestamp = result.rawCells()[0].getTimestamp(); // from hbase-0.96.0
        LazyObjectBase lz = fields[fieldID];
        if (lz instanceof LazyTimestamp) {
          ((LazyTimestamp) lz).getWritableObject().setTime(timestamp);
        } else {
          ((LazyLong) lz).getWritableObject().set(timestamp);
        }
      } 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

        LazyPrimitive<? extends ObjectInspector, ? extends Writable> key =
          LazyFactory.createLazyPrimitiveClass(
              (PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(),
              binaryStorage.get(0));

        ByteArrayRef keyRef = new ByteArrayRef();
        keyRef.setData(e.getKey());
        key.init(keyRef, 0, keyRef.getData().length);

        // Value
        LazyObject<?> value =
          LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(),
              binaryStorage.get(1));

        ByteArrayRef valueRef = new ByteArrayRef();
        valueRef.setData(e.getValue());
        value.init(valueRef, 0, valueRef.getData().length);

        // Put the key/value into the map
        cachedMap.put(key.getObject(), value.getObject());
      }
    }
View Full Code Here

    ObjectInspector fieldOI = oi.getAllStructFieldRefs().get(fieldID).getFieldObjectInspector();

    LazyObject<? extends ObjectInspector> lazyObject = LazyFactory
        .createLazyObject(fieldOI);

    ByteArrayRef ref = new ByteArrayRef();

    ref.setData(bytes);

    // initialize the lazy object
    lazyObject.init(ref, 0, ref.getData().length);

    return lazyObject;
  }
View Full Code Here

            serDeParams.isLastColumnTakesRest(), serDeParams.isEscaped(),
            serDeParams.getEscapeChar());

    LazyStruct struct = (LazyStruct) LazyFactory.createLazyObject(structOI);

    ByteArrayRef bytes = new ByteArrayRef();
    bytes.setData("row value1 value2".getBytes());
    struct.init(bytes, 0, bytes.getData().length);

    // Serialize the struct into a mutation
    Mutation m = serializer.serialize(struct, structOI);

    // Write the mutation
View Full Code Here

            .getNullSequence(), serDeParams.isLastColumnTakesRest(), serDeParams.isEscaped(),
            serDeParams.getEscapeChar());

    LazyStruct struct = (LazyStruct) LazyFactory.createLazyObject(structOI);

    ByteArrayRef bytes = new ByteArrayRef();
    bytes.setData("row value1 value2".getBytes());
    struct.init(bytes, 0, bytes.getData().length);

    // Serialize the struct into a mutation
    Mutation m = serializer.serialize(struct, structOI);

    // Write the mutation
View Full Code Here

  /*
   * split pairs by delimiter.
   */
  private Object uncheckedGetField(int id) {
    if (!getFieldInited()[id]) {
      ByteArrayRef ref;
      ColumnMapping columnMapping = columnMappings.get(id);

      if (columnMapping instanceof HiveAccumuloMapColumnMapping) {
        HiveAccumuloMapColumnMapping mapColumnMapping = (HiveAccumuloMapColumnMapping) columnMapping;

        LazyAccumuloMap map = (LazyAccumuloMap) getFields()[id];
        map.init(row, mapColumnMapping);
      } else {
        if (columnMapping instanceof HiveAccumuloRowIdColumnMapping) {
          // Use the rowID directly
          ref = new ByteArrayRef();
          ref.setData(row.getRowId().getBytes());
        } else if (columnMapping instanceof HiveAccumuloColumnMapping) {
          HiveAccumuloColumnMapping accumuloColumnMapping = (HiveAccumuloColumnMapping) columnMapping;

          // Use the colfam and colqual to get the value
          byte[] val = row.getValue(new Text(accumuloColumnMapping.getColumnFamily()), new Text(
              accumuloColumnMapping.getColumnQualifier()));
          if (val == null) {
            return null;
          } else {
            ref = new ByteArrayRef();
            ref.setData(val);
          }
        } else {
          log.error("Could not process ColumnMapping of type " + columnMapping.getClass()
              + " at offset " + id + " in column mapping: " + columnMapping.getMappingSpec());
          throw new IllegalArgumentException("Cannot process ColumnMapping of type "
              + columnMapping.getClass());
        }

        getFields()[id].init(ref, 0, ref.getData().length);
      }

      // HIVE-3179 only init the field when it isn't null
      getFieldInited()[id] = true;
    }
View Full Code Here

      // Keys are always primitive, respect the binary
      LazyPrimitive<? extends ObjectInspector,? extends Writable> key = LazyFactory
          .createLazyPrimitiveClass((PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(),
              ColumnEncoding.BINARY == columnMapping.getKeyEncoding());

      ByteArrayRef keyRef = new ByteArrayRef();
      keyRef.setData(cq.getBytes(Charsets.UTF_8));
      key.init(keyRef, 0, keyRef.getData().length);

      // Value can be anything, use the obj inspector and respect binary
      LazyObject<?> value = LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(),
          ColumnEncoding.BINARY == columnMapping.getValueEncoding());

      ByteArrayRef valueRef = new ByteArrayRef();
      valueRef.setData(tuple.getValue());
      value.init(valueRef, 0, valueRef.getData().length);

      cachedMap.put(key, value);
    }

    this.setParsed(true);
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.