Open Dustin-Ray opened 1 month ago
/bounty $100
/attempt #113
with your implementation plan. Note: we will only assign an issue if you include an implementation plan with a time estimate. Additionally, to be assigned an issue, you must have previously contributed to the project. You can still work on an issue and submit a PR without being assigned./claim #113
in the PR body to claim the bountyThank you for contributing to spaceandtimelabs/sxt-proof-of-sql!
Add a bounty ā¢ Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
š¢ @onyedikachi-david | Sep 27, 2024, 1:25:00 PM | WIP |
š¢ @Bhavyajain21 | Sep 28, 2024, 4:16:59 PM | WIP |
š¢ @pulkitgovrani | #196 |
/attempt #113
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@onyedikachi-david | 7 bounties from 4 projects | JavaScript, Shell |
ļ¹168, ļ¹163 |
Cancel attempt |
/attempt #113
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@Bhavyajain21 | 15 bounties from 3 projects | TypeScript, Rust, JavaScript & more |
Cancel attempt |
š” @pulkitgovrani submitted a pull request that claims the bounty. You can visit your bounty board to reward.
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.