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

SNOW-1504369: Time value regression after 3.13.31 #1805

Closed
dmytro-sylaiev opened this issue Jun 25, 2024 · 3 comments
Closed

SNOW-1504369: Time value regression after 3.13.31 #1805

dmytro-sylaiev opened this issue Jun 25, 2024 · 3 comments
Assignees
Labels
bug status-information_needed Additional information is required from the reporter status-triage_done Initial triage done, will be further handled by the driver team

Comments

@dmytro-sylaiev
Copy link

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.13.30 vs 3.13.34 [31]

  2. What operating system and processor architecture are you using?
    Win11/Talend studio

  3. What version of Java are you using?
    11/17

  4. What did you do?

    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.

Create a table with TIME column
Insert value 00:00:44 and do the plain select via jdbc driver (ResultSet::getTime)

with 3.13.30 it's 44580 for me and starting from 3.13.31 it's -10755420

  1. What did you expect to see?
    value is the same
    What should have happened and what happened instead?
    value has changed

I did some research and it seems it's starting from #1383
Before BigIntToTimeConverter returned a UTC time value with timezone, and after it's already the timezoned value for java.sql.Time

The deactivation of useSessionTimezone flag might help but would affect other columns' values.

@github-actions github-actions bot changed the title Time value regression after 3.13.31 SNOW-1504369: Time value regression after 3.13.31 Jun 25, 2024
@sfc-gh-wfateem sfc-gh-wfateem self-assigned this Jul 1, 2024
@sfc-gh-wfateem sfc-gh-wfateem added the status-triage Issue is under initial triage label Jul 1, 2024
@sfc-gh-wfateem
Copy link
Collaborator

Hi @dmytro-sylaiev,

Thank you for opening this issue. I checked out the main branch and tried to reproduce what you're seeing with the following code:

    connection = getConnection();
    statement = connection.createStatement();
    statement.executeQuery("Alter session set JDBC_USE_SESSION_TIMEZONE=false");
    statement.executeQuery("CREATE OR REPLACE TABLE T_TIME(time_col TIME)");
    statement.executeQuery("INSERT INTO T_TIME VALUES('00:00:44')");
    ResultSet resultSet = statement.executeQuery("Select time_col from T_TIME");
    Time t = Time.valueOf("00:00:44");
    resultSet.next();
    Time result_t = resultSet.getTime(1);
    assertEquals(t, result_t);

That test passes, so I'm not observing the same issue you are.

What is the TIMEZONE parameter set to in Snowflake at your end?

show parameters like 'timezone';

Have you tested this with JDBC driver version 3.16.1?

@sfc-gh-wfateem sfc-gh-wfateem added status-information_needed Additional information is required from the reporter status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Jul 1, 2024
@sfc-gh-wfateem
Copy link
Collaborator

Hey @dmytro-sylaiev,

Did you get the chance to look over my last comment?

@sfc-gh-wfateem
Copy link
Collaborator

I'm going to close this issue since there are no updates. If you still need help with this then please feel free to reopen this issue again with more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-information_needed Additional information is required from the reporter status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants