snowflake-jdbc: SNOW-1196082: Inserting and reading timestamps is not symetric if too much columns inserted with batch

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using? 3.15.0

  2. What operating system and processor architecture are you using? Mac or Alma Linux

  3. What version of Java are you using? Java 8

  4. What did you do?

After inserting rows with timestamps values using PreparedStatement and batch, when reading back the rows , some values are shifted. The shift actually depends of the timezone of the machine you are running on ( be sure not to be on UTC to see the problem) Note that this does not happen with older driver version like 3.13.15

It depends on ‘how many columns’ are inserted. With 3, there was no problem, with 8, the problem appears

The following program describe the problem (just change the boolean bug to false or true to exercise with 3 or 8 columns )

report_bug_timestamp.txt

  1. What did you expect to see?

    The values read should be the one that was written

  2. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

  3. What is your Snowflake account identifier, if any? (Optional)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Hello Eric,

Thanks for the update. When I put the TimeZone.setDefault(TimeZone.getTimeZone(“Australia/Sydney”)); st starting after connection and statement, I am able to reproduce it. We are working on it.

Regards, Sujan