Package org.apache.hadoop.hive.common.type

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.bigDecimalValue()


      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.set(scratch.getBytes(bufferUsed), dec.getScale());

      HiveDecimal hd = hdw.getHiveDecimal();

      BigDecimal readValue = hd.bigDecimalValue();

      assertEquals(value, readValue);

      // Now test fastUpdate from the same serialized HiveDecimal
      Decimal128 decRead = new Decimal128().fastUpdateFromInternalStorage(
View Full Code Here


      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.set(scratch.getBytes(bufferUsed), d.getScale());

      HiveDecimal hd = hdw.getHiveDecimal();

      BigDecimal readValue = hd.bigDecimalValue();

      assertEquals(d.toBigDecimal().stripTrailingZeros(),
          readValue.stripTrailingZeros());
    }
}
View Full Code Here

        resultText.set(numberFormat.format(xFloatValue));
        break;
      case DECIMAL:
        xDecimalValue = ((HiveDecimalObjectInspector) argumentOIs[0])
            .getPrimitiveJavaObject(arguments[0].get());
        resultText.set(numberFormat.format(xDecimalValue.bigDecimalValue()));
        break;
      case BYTE:
      case SHORT:
      case INT:
        xIntValue = ((IntObjectInspector) argumentOIs[0]).get(arguments[0].get());
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.