tustvold opened a new issue, #1779: URL: https://github.com/apache/arrow-rs/issues/1779
**Describe the bug** DataType::Decimal is defined as ``` /// Exact decimal value with precision and scale /// /// * precision is the total number of digits /// * scale is the number of digits past the decimal /// /// For example the number 123.45 has precision 5 and scale 2. Decimal(usize, usize), ``` This appears to be at odds with both the [C++](https://arrow.apache.org/docs/cpp/api/datatype.html?highlight=decimal#classarrow_1_1_decimal128_type) and [python](https://arrow.apache.org/docs/python/generated/pyarrow.decimal128.html) implementations (I can't actually find the specification). These define it as > Arrow decimals are fixed-point decimal numbers encoded as a scaled integer. The precision is the number of significant digits that the decimal type can represent; the scale is the number of digits after the decimal point (note the scale can be negative). In particular with the current rust definition it is unclear how to represent numbers with more than 38 digits, either because of leading or trailing 0s. **To Reproduce** Inspect code **Expected behavior** We should be conforming to the other arrow implementations **Additional context** Noticed whilst reviewing https://github.com/apache/arrow-datafusion/pull/2680 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
