-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update bigdecimal from 0.4.1 to 0.4.6 #13569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @jonahgao for taking care on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @jonahgao, it is an elegant solution 👍
Btw, I was experimenting with env var, I didn't work well |
I tested it on this branch, and it works except for one query. |
Good catch |
// Round the value to limit the number of decimal places | ||
let value = value.round(12).normalized(); | ||
// Format the value to a string | ||
format_big_decimal(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use bigdecimal to_plain_string
(see akubera/bigdecimal-rs#135) -- but it's not released yet afaict
fwiw, i faced same issuues when upgrading the bigdecimal dep in an internal project based on DataFusion and felt the same. |
Which issue does this PR close?
Closes #10001.
Rationale for this change
We use the bigdecimal crate to format decimal values to strings and display them in sqllogical tests(SLTs).
The new version of bigdecimal formats certain decimals in scientific notation, which will break many SLT tests.
There are two possible solutions:
RUST_BIGDECIMAL_FMT_EXPONENTIAL_LOWER_THRESHOLD
. However, I'm a bit concerned about whether it's appropriate to operate environment variables in a library like DataFusion. Additionally, we might need to introduce a separate Cargo config.toml into the project root directory so thatcargo test --test sqllogictests
can work.This PR takes the latter approach.
What changes are included in this PR?
Are these changes tested?
Yes. By new UTs and existing SLT tests.
Are there any user-facing changes?
No. Only modified the test engine.