-
Notifications
You must be signed in to change notification settings - Fork 174
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
SNOW-572407: Floating point values are truncated #898
Comments
+1 seems like a pretty basic flaw. |
Thank you for reporting this issue. It appears that the problem is a known issue with JSON formatting. The solution is to switch to the arrow format, which will resolve the problem. We have reported this to the backend team, and once they have addressed the issue, the JDBC driver should be able to handle precision loss without any changes. In the meantime, you can try using the to_decimal/to_number functions to retain precision. |
This is playing catch 22 with the JDBC driver
|
So to get lossless |
The to_decimal/to_number workaround is not applicable to general double-precision values, because the range of exponents cannot be expressed as a fixed-point result. Is there any other workaround? Can double-precision values be cast to text and preserve the full precision and range, e.g. I'm guessing that
OK, |
Curious to know why this issue was closed. Was the underlying bug fixed? |
Closed as "that sounds hard" ;-) |
When reading a double value from the server, it is always truncated to 8 digits. Full range of 16 digits should be preserved.
Test here: https://github.com/slawo-ch/SnowflakeBugs/blob/main/src/test/java/FloatsTest.java
Possibly related to
ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON';
which is a required setting unless you want to run insecure VMs.See: #533
The text was updated successfully, but these errors were encountered: