Jefffrey commented on code in PR #10304:
URL: https://github.com/apache/arrow-rs/pull/10304#discussion_r3552032653
##########
arrow-schema/src/datatype.rs:
##########
@@ -361,12 +361,12 @@ pub enum DataType {
///
/// For example the number 123.45 has precision 5 and scale 2.
///
- /// In certain situations, scale could be negative number. For
- /// negative scale, it is the number of padding 0 to the right
- /// of the digits.
+ /// In certain situations, scale can be negative. Negative scale
+ /// rounds values to the left of the decimal point, and precision is
+ /// the maximum number of non-rounded digits.
///
- /// For example the number 12300 could be treated as a decimal
- /// has precision 3 and scale -2.
+ /// For example, with precision 2 and scale -3, the value 12345 is
+ /// rounded to 12000 and represented as the stored integer 12.
Review Comment:
i find it a little confusing that we talk about how `12345` is converted to
a negative scale decimal here, instead of in cast kernels 🤔
imo at this level all we care about is explaining how values already stored
as decimals are represented and what they actually represent, aka we can say a
value of `12` but with `-3` scale is equivalent to `12000`
(i skimmed the linked discussion so maybe this was already discussed 😅)
--
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]