-
Notifications
You must be signed in to change notification settings - Fork 80
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
refactor: remove intermediate decimal and move decimal into PoSQL parser crate #113
Labels
Comments
Dustin-Ray
added
good first issue
Good for newcomers
and removed
good first issue
Good for newcomers
labels
Sep 7, 2024
💎 $100 bounty • Space and TimeSteps to solve:
Thank you for contributing to spaceandtimelabs/sxt-proof-of-sql! Add a bounty • Share on socials
|
/attempt #113
|
/attempt #113
|
JayWhite2357
added
enhancement
New feature or request
refactor
Code cleanup or reorganization
and removed
enhancement
New feature or request
labels
Oct 8, 2024
This is blocking me at the moment, and none of the active PRs are passing CI or appear to be close enough to complete this quickly enough. I am closing the bounty in favor of #283. |
Hi @JayWhite2357 , this issue is resolved, right? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background and Motivation
Currently, the code handling decimal parsing and conversions is somewhat scattered. This issue seeks to resolve this by using the
bigdecimal::BigDecimal
type for as much as possible.Important Note: the
BigDecimal
type does not trim leading and trailing zeros. Care should be taken when dealing with this.Requested Changes
To resolve this issue, we should:
BigDecimalExt
extension trait in theproof_of_sql::base::math
module. It should have, at minimum,precision
andscale
methods akin to the existingIntermediateDecimal::precision
andIntermediateDecimal::scale
methods. NOTE: the precision and scale should be the values after trimming any leading and trailing zeros. This is what the current implementation (implicitly) does.try_into_scalar_with_precision_and_scale
method akin to the exitingtry_into_to_scalar
function.proof_of_sql_parser::intermediate_decimal::IntermediateDecimal
andproof_of_sql::base::math::decimal::Decimal
types, in favor of usingbigdecimal::BigDecimal
along with theBigDecimalExt
extension trait.Optional:
DecimalError
enum is needed or ifbigdecimal::ParseBigDecimalError
or similar is sufficient.scale_scalar
function should likely be moved into theproof_of_sql::base::scalar
module.The text was updated successfully, but these errors were encountered: