public int compareTo(HiveDecimalWritable that) {
return getHiveDecimal().compareTo(that.getHiveDecimal());
}
public static void writeToByteStream(Decimal128 dec, Output byteStream) {
HiveDecimal hd = HiveDecimal.create(dec.toBigDecimal());
LazyBinaryUtils.writeVInt(byteStream, hd.scale());
byte[] bytes = hd.unscaledValue().toByteArray();
LazyBinaryUtils.writeVInt(byteStream, bytes.length);
byteStream.write(bytes, 0, bytes.length);
}