-
Notifications
You must be signed in to change notification settings - Fork 258
feat: Support casting string float types #2835
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
feat: Support casting string float types #2835
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2835 +/- ##
============================================
+ Coverage 56.12% 59.58% +3.45%
- Complexity 976 1365 +389
============================================
Files 119 167 +48
Lines 11743 15490 +3747
Branches 2251 2567 +316
============================================
+ Hits 6591 9230 +2639
- Misses 4012 4962 +950
- Partials 1140 1298 +158 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e7a1144 to
79d0ea9
Compare
|
Fixed issues with formatting |
|
Fixed failing tests and added some more . Also modularized to replicate spark's behavior |
|
Reasons for the tests to be failing :
|
|
The failures were largely semantic caused due to mismatch in the error message (whitespace) and test nomenclature |
|
The cast suite was specifically testing for |
|
The tests are all passing. PR is ready for review |
|
Splitting this into multiple PRs for better readability |
andygrove
left a comment
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 @coderfender
|
Thank you @andygrove |
|
@coderfender There is a clippy warning: |
|
@andygrove thank you very much . Let me fix the warning and push a commit right away |
|
@andygrove pushed a commit to fix clippy errors. Please kickoff CI whenever you get a chance |
|
@andygrove the CI is passing now . Please merge it whenever you get a chance . Thank you |
Which issue does this PR close?
Closes #326 (part 1 - String to Float casts)
Rationale for this change
Comet currently supports some basic string -> non int casts and this PR essentially extends on that to support all possible casts from string to float/double (decimal casts are covered in a different PR)
What changes are included in this PR?
Updates to cast logic to support exhaustive casts from string to numeric float
Float inputs (which should include DoubleType)
How are these changes tested?
Unit tests for specific edge cases like infinity, scientific notations etc (covering the edge cases mentioned in the linked issue) and fuzz tests to make sure all valid/invalid inputs are verified
cc : @andygrove , @martin-g