(fix): Decimal Parsing Error with e+06 Format#22746
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
### Root Cause In `pkg/container/types/decimal.go`, the `Parse64` function only handled the minus sign (`-`) in scientific notation exponents but not the plus sign (`+`). The `Parse128` function already handled both cases correctly. Approved by: @heni02
### Root Cause In `pkg/container/types/decimal.go`, the `Parse64` function only handled the minus sign (`-`) in scientific notation exponents but not the plus sign (`+`). The `Parse128` function already handled both cases correctly. Approved by: @heni02
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22396
What this PR does / why we need it:
Root Cause
In
pkg/container/types/decimal.go, theParse64function only handled the minus sign (-) in scientific notation exponents but not the plus sign (+). TheParse128function already handled both cases correctly.PR Type
Bug fix, Tests
Description
Fix
Parse64function to handle plus sign in scientific notation exponentsAdd comprehensive unit tests for scientific notation parsing
Add distributed test cases for decimal scientific notation support
Diagram Walkthrough
File Walkthrough
decimal.go
Add plus sign support to scientific notation parsingpkg/container/types/decimal.go
+) in scientific notation exponents-) already present in thefunction
Parse64to correctly parse formats like1.23456789e+06decimal_test.go
Add scientific notation unit tests for Parse64pkg/container/types/decimal_test.go
TestParse64ScientificNotationwith four testcases
e+06format (the bug case from issue [Bug]: decimal parsing error #22396)e6format without explicit plus signe-06format with negative exponent ande+2format with smallexponent
decimal_scientific_notation.test
Add distributed test cases for scientific notationtest/distributed/cases/dtype/decimal_scientific_notation.test
e+06,e6,e-06, ande+2formatsdecimal_scientific_notation.result
Add expected results for distributed teststest/distributed/cases/dtype/decimal_scientific_notation.result