@Override void serialize(RandomAccessOutput byteStream, Object obj, ObjectInspector objInspector, boolean skipLengthPrefix, BooleanRef warnedOnceNullMapKey) { HiveDecimalObjectInspector bdoi = (HiveDecimalObjectInspector) objInspector; HiveDecimalWritable t = bdoi.getPrimitiveWritableObject(obj); if (t == null) { return; } writeToByteStream(byteStream, t); } }
@Override public void writeHiveDecimal(HiveDecimalWritable decWritable, int scale) throws IOException { beginElement(); if (scratchLongs == null) { scratchLongs = new long[HiveDecimal.SCRATCH_LONGS_LEN]; scratchBuffer = new byte[HiveDecimal.SCRATCH_BUFFER_LEN_BIG_INTEGER_BYTES]; } LazyBinarySerDe.writeToByteStream( output, decWritable, scratchLongs, scratchBuffer); finishElement(); }
@Override public void writeHiveDecimal(HiveDecimal dec, int scale) throws IOException { beginElement(); if (scratchLongs == null) { scratchLongs = new long[HiveDecimal.SCRATCH_LONGS_LEN]; scratchBuffer = new byte[HiveDecimal.SCRATCH_BUFFER_LEN_BIG_INTEGER_BYTES]; } LazyBinarySerDe.writeToByteStream( output, dec, scratchLongs, scratchBuffer); finishElement(); }
return; writeToByteStream(byteStream, t); return;
@Override void serialize(RandomAccessOutput byteStream, Object obj, ObjectInspector objInspector, boolean skipLengthPrefix, BooleanRef warnedOnceNullMapKey) { HiveDecimalObjectInspector bdoi = (HiveDecimalObjectInspector) objInspector; HiveDecimalWritable t = bdoi.getPrimitiveWritableObject(obj); if (t == null) { return; } writeToByteStream(byteStream, t); } }
@Override public void writeHiveDecimal(HiveDecimal dec, int scale) throws IOException { beginElement(); if (scratchLongs == null) { scratchLongs = new long[HiveDecimal.SCRATCH_LONGS_LEN]; scratchBuffer = new byte[HiveDecimal.SCRATCH_BUFFER_LEN_BIG_INTEGER_BYTES]; } LazyBinarySerDe.writeToByteStream( output, dec, scratchLongs, scratchBuffer); finishElement(); }
@Override public void writeHiveDecimal(HiveDecimalWritable decWritable, int scale) throws IOException { beginElement(); if (scratchLongs == null) { scratchLongs = new long[HiveDecimal.SCRATCH_LONGS_LEN]; scratchBuffer = new byte[HiveDecimal.SCRATCH_BUFFER_LEN_BIG_INTEGER_BYTES]; } LazyBinarySerDe.writeToByteStream( output, decWritable, scratchLongs, scratchBuffer); finishElement(); }
return; writeToByteStream(byteStream, t); return;