Skip to content
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

Precision lost when inserting java.lang.Double into VARCHAR in Snowflake #1109

Closed
koszta5 opened this issue Jul 28, 2022 · 1 comment
Closed
Labels

Comments

@koszta5
Copy link

koszta5 commented Jul 28, 2022

We have traced down a bug in snowflake (likely on the backend for jdbc driver) which happens when sending java.lang.Double types into snowflake columns that are defined as VARCHAR columns. Json sent via jdbc driver to snowflake cloud contains the precision correctly but it is not stored correctly to snowflake

REPRODUCER:

STEP #1 - create varchar table
Create table OB_OPNTOTALMFGCOST (
Period1 varchar(16777216)
)

STEP #2 - insert java Double value with maximum precision
Double value = Double.valueOf("0.08072205302271099");
... use JDBC template to insert...

STEP #3 - select from snowflake:
select * from OB_OPNTOTALMFGCOST;
==> 0.08072205302

Precision is lost :(

Workaround: send it as string - but type autoconversion should work fine...

@sfc-gh-igarish
Copy link
Collaborator

To clean up and re-prioritize more pressing bugs and feature requests we are closing all issues older than 6 months as of March 1, 2023. If there are any issues or feature requests that you would like us to address, please create them according to the new templates we have created. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants