Description
public static void writeToByteStream(RandomAccessOutput byteStream, HiveDecimalWritable decWritable) { LazyBinaryUtils.writeVInt(byteStream, decWritable.scale()); // NOTE: This writes into a scratch buffer within HiveDecimalWritable. // int byteLength = decWritable.bigIntegerBytesInternalScratch(); LazyBinaryUtils.writeVInt(byteStream, byteLength); byteStream.write(decWritable.bigIntegerBytesInternalScratchBuffer(), 0, byteLength); }
Can end up writing 0 bytes as byteLength since a non-null HiveDecimalWritable does not mean a non-null HiveDecimal is contained inside it.