-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
change SQL literal numeric type from Float64
to Decimal128
#3395
change SQL literal numeric type from Float64
to Decimal128
#3395
Conversation
@liukun4515 could you take a look at this conversion? |
Float64
to Decimal128
I will take a look later |
Thanks for working on this @kmitchener. We really need to be able to parse numeric literals as either float or decimal. We don't need to do all of this in this PR, but we should make sure we file follow-on issues for anything not included here. Per the ANSI SQL specification:
|
That's extremely helpful, thanks. What source are you using for the SQL specification? |
In Postgres, these variants all get converted to decimals. https://dbfiddle.uk/CSN4-3op sqlparser-rs is doing something funky with the "e" notation, so I'll add some follow-on issues for that. |
added tests, fixed some tests
Is this pull request ready for review @kmitchener ? I ask because it is still marked as draft |
Hi @alamb, no, it's still draft. I've learned a bit since this PR and am figuring out next steps and also working on other PRs that will make this final PR smaller. I can close this and submit a new PR when the change is finally ready if that's preferable? At this point, I need to make more changes before this is ready for review. |
Sounds good. I am just trying to keep tabs on PRs in this repo to keep them moving, which is why i asked. I'll close this one to signify it doesn't need any additional attention at this time. Thanks for all your help so far @kmitchener |
Which issue does this PR close?
Closes #3394 .
Rationale for this change
What changes are included in this PR?
Per issue, switches SQL non-integer literals to Decimal128 instead of Float64.
Are there any user-facing changes?