-
Notifications
You must be signed in to change notification settings - Fork 105
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
Bug: Decimal edge case failure #3949
Comments
The crux of the problem here is that literals are still interpreted as DOUBLE, whereas in DuckDB, they're interpreted as DECIMAL. In bug 1 and 2, the issue is that there is then floating point imprecision when you attempt to cast the doubles to decimals. In bug 3, the only reason DuckDB gives the correct result is because the arithmetic is DECIMAL arithmetic.
Gives the same result we give. |
The crux of the problem here is that literals are still interpreted as DOUBLE, whereas in DuckDB, they're interpreted as DECIMAL. |
Changing the default interpretation to decimal breaks a lot of things. I'm not sure where to interpret the number as a decimal in this case. Perhaps when it comes to inserting into something with a known schema, we should interpret literals as a string and then apply casting. Edit: Xiyang told me this solution is really slow. We may have to delay this fix until after the release. |
Kùzu version
master
What operating system are you using?
macOS M1
What happened?
bug1.
Should throw an exception since 100000000000000000000000000000000000000.000000000000000000000000000000 is out of range.
bug2.
should throw an exception as well
bug3.
incorrect result when adding decimal with double:
kuzu:
duckdb:
Are there known steps to reproduce?
No response
The text was updated successfully, but these errors were encountered: