snowflakedb / snowflake-jdbc

Snowflake JDBC Driver
Apache License 2.0
178 stars 170 forks source link

SnowflakeLoggedFeatureNotSupportedException being thrown from getObject(int columnIndex, Class<T> type) after driver upgrade #1431

Closed itaseskii closed 1 year ago

itaseskii commented 1 year ago

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 (Issue starts appearing from 3.13.20 onwards)

  2. What operating system and processor architecture are you using?

    _Linux Debian x8664

  3. What version of Java are you using?

    Java 17

  4. What did you do?

    In the Airbyte destination Snowflake connector we have upgraded the driver from 3.13.19 to 3.13.30 and have started getting net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException from resultSet.getObject(index, OffsetDateTime.class)

    https://github.com/airbytehq/airbyte/issues/25849

  5. What did you expect to see?

    The object being returned as OffsetDateTime as previously without any errors.

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

snowflake_jdbc0.log

  1. What is your Snowflake account identifier, if any? (Optional)
sfc-gh-spanaite commented 1 year ago

Hi @itaseskii , I don't see any changes in JDBC driver code that would cause this exception since we never supported getObject(int columnIndex, Class<T> type).

Can you do the same test using JDBC 3.13.19 and provide me the log?

sfc-gh-spanaite commented 1 year ago

Hi @itaseskii , did you had a chance to re-run the test with 3.13.19 as requested?

itaseskii commented 1 year ago

Hey @sfc-gh-spanaite that was my conclusion as well. Making a comparison of the source code between 3.13.19 and 3.13.20 getObject(int columnIndex, Class<T> type) seemed unsupported in both versions. As an attachment I'm sending you the log file of both versions.

snowflake_jdbc0_3.13.19.log snowflake_jdbc0_3.13.20.log

sfc-gh-spanaite commented 1 year ago

Hi @itaseskii , thanks for providing the logs but they only confirm my suspicion: you get exactly the same stack trace on both versions:

{"timestamp":"1687901317779","message":{"type":"client_sql_exception","DriverType":"JDBC","DriverVersion":"3.13.19","SQLState":"0A000","Stacktrace":"net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException\n\t
 at net.snowflake.client.jdbc.SnowflakeBaseResultSet.getObject(SnowflakeBaseResultSet.java:1291)\n\t
 at com.zaxxer.hikari.pool.HikariProxyResultSet.getObject(HikariProxyResultSet.java)\n\t
 at io.airbyte.db.jdbc.AbstractJdbcCompatibleSourceOperations.getObject(AbstractJdbcCompatibleSourceOperations.java:229)\n\t
 at io.airbyte.db.jdbc.AbstractJdbcCompatibleSourceOperations.putTimestamp(AbstractJdbcCompatibleSourceOperations.java:135)\n\t
 at io.airbyte.db.jdbc.JdbcSourceOperations.copyToJsonField(JdbcSourceOperations.java:60)\n\t
{"timestamp":"1687900297044","message":{"type":"client_sql_exception","DriverType":"JDBC","DriverVersion":"3.13.20","SQLState":"0A000","Stacktrace":"net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException\n\t
 at net.snowflake.client.jdbc.SnowflakeBaseResultSet.getObject(SnowflakeBaseResultSet.java:1291)\n\t
 at com.zaxxer.hikari.pool.HikariProxyResultSet.getObject(HikariProxyResultSet.java)\n\t
 at io.airbyte.db.jdbc.AbstractJdbcCompatibleSourceOperations.getObject(AbstractJdbcCompatibleSourceOperations.java:229)\n\t
 at io.airbyte.db.jdbc.AbstractJdbcCompatibleSourceOperations.putTimestampWithTimezone(AbstractJdbcCompatibleSourceOperations.java:239)\n\t
 at io.airbyte.db.jdbc.JdbcSourceOperations.copyToJsonField(JdbcSourceOperations.java:61)\n\t

To me this looks to be something coming from Airbyte since they use a getObject method with 2 args (in AbstractJdbcCompatibleSourceOperations.java) as you can see here.

itaseskii commented 1 year ago

Hey @sfc-gh-spanaite, that isn't the case in the integration tests. the tests with 3.13.19 are passing without any issue or SnowflakeLoggedFeatureNotSupportedException log.

Screenshot_20230628_172636

Initially I thought that it might be a different code path being executed between the versions but the error log that I have sent you shows the SnowflakeLoggedFeatureNotSupportedException being present in both files...

sfc-gh-spanaite commented 1 year ago

@itaseskii Can you maybe give me a sample code of the tests you're running? I've tried reproducing from my side with both 3.13.19 and 3.13.20 and I get exactly the same stack trace and exception and the log looks identical.

The only change that I can see in 3.13.20 was to map timestamp_tz to java.sql.Type TIMESTAMP_WITH_TIMEZONE and update getTimestamp() in JSON result set to include the new timestamp_tz, but I wouldn't expect this to cause the issue.

Without a sample code for the integration test that's failing it will be hard to confirm if this is coming from our JDBC driver.

sfc-gh-spanaite commented 1 year ago

@itaseskii Do you still have the issue and if yes can you provide me a sample code?

sfc-gh-spanaite commented 1 year ago

Hi @itaseskii , I am closing this issue since I've not received any feedback from you. If you still have the issue feel free to open a new issue and provide a sample code.