The current (1.10.1) Avro spec is a little light on explanation for
the decimal logical type:
https://avro.apache.org/docs/1.10.1/spec.html#Decimal.

It says "scale" is "a JSON integer representing the scale," and
"precision" is "a JSON integer representing the (maximum) precision of
decimals stored in this type."

Scale is further specified to be non-negative, and precision is positive.

What are the precision and scale required to represent a decimal like
"1.234E10?" I would think that has a scale of 10 and a precision of 4.
But from perusing code, it appears that this would be treated as a
decimal with a scale of 0, and a precision of 10, which seems quite
far off! If I'm right about that (and I might not be!), then why is a
scale strictly non-negative, and why are all the meaningless zeroes
included in describing "precision?"

Reply via email to