> https://github.com/Parquet/parquet-format/blob/master/LogicalTypes.md#decimal
This references is helpful. Thank you. I read: - fixed_len_byte_array: precision is limited by the array size. Length n can store <= floor(log_10(2^(8*n - 1) - 1))base-10 digits This effectively states that Decimals are being stored as a BigInteger byte[] of the unscaled value. I suspect this means that the serialization path is something like: myBigDecimal.unscaledValue().toByteArray(); since the target is a fixed_len_byte_array it looks like the sign bit must get replicated. Thanks! Michael On Tue, Mar 15, 2016 at 12:26 PM, Nong Li <[email protected]> wrote: > I think that's similar to what we have: > > > https://github.com/Parquet/parquet-format/blob/master/LogicalTypes.md#decimal > > On Mon, Mar 14, 2016 at 12:36 PM, Michael Howard <[email protected]> > wrote: > > > Ryan Blue wrote: > > > > > * Decimal is supported if the backing primitive type is fixed-length > > binary > > > > I was a little surprised to read this. > > > > Q: Where can I learn more about current parquet support for Decimal / > > BigDecimal? > > > > To be clear, I have not followed this for some time but ... > > > > I thought that there was support for fixed point decimal with an INT64 > base > > type and an implied decimal position as a property ... for up to 18 > digits > > precision. > > > > If Decimal is being stored as fixed-length binary, for the Java > > implementation I wonder what mechanism is being used to serialize the > > BigDecimal ... since java.math.BigDecimal does not expose a path for byte > > serialization ... except through java.math.BigInteger > > > > > > Michael > > >
