You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am retrieving data from a postgres database with diesel. The table's schema is tagged with a Numeric meta-type, which I deserializing in to BigDecimal:
but now I'm trying to figure out what parquet wants me to write out. The parquet logical types have this bit of info about byte representations:
/// A decimal value.
/// This may be used to annotate binary or fixed primitive types. The
/// underlying byte array stores the unscaled value encoded as two's
/// complement using big-endian byte order (the most significant byte is the
/// zeroth element).
///
/// This must be accompanied by a (maximum) precision and a scale in the
/// SchemaElement. The precision specifies the number of digits in the decimal
/// and the scale stores the location of the decimal point. For example 1.23
/// would have precision 3 (3 total digits) and scale 2 (the decimal point is
/// 2 digits over).
DECIMAL,
I guess the pressing question is, how can I get the big-endian byte representation out of a BigDecimal? Looking over the implementation and it's got a lot of support for data types in but not so much out. Would the project be open to a PR addressing this need?
The text was updated successfully, but these errors were encountered:
I am retrieving data from a postgres database with diesel. The table's schema is tagged with a
Numeric
meta-type, which I deserializing in to BigDecimal:but now I'm trying to figure out what parquet wants me to write out. The parquet logical types have this bit of info about byte representations:
I guess the pressing question is, how can I get the big-endian byte representation out of a
BigDecimal
? Looking over the implementation and it's got a lot of support for data types in but not so much out. Would the project be open to a PR addressing this need?The text was updated successfully, but these errors were encountered: