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-591937: Execute query - error in new driver 3.13.18 #1003

Closed
r331 opened this issue May 18, 2022 · 2 comments
Closed

SNOW-591937: Execute query - error in new driver 3.13.18 #1003

r331 opened this issue May 18, 2022 · 2 comments
Assignees

Comments

@r331
Copy link

r331 commented May 18, 2022

I have in my project driver "net.snowflake:snowflake-jdbc:3.10.3"
Everything works fine.
My code:

DataSourceBuilder.create()
            .driverClassName("net.snowflake.client.jdbc.SnowflakeDriver")
            .url("jdbc:snowflake://ivanov_dev.snowflakecomputing.com:443?warehouse=DEMO_WH&db=SNOWFLAKE_SAMPLE_DATA")
            .username(credentials.username())
            .password(credentials.password())
            .build()

I upgrade it to 3.13.18 and get such an error:

org.springframework.jdbc.UncategorizedSQLException: StatementCallback;
 uncategorized SQLException for SQL [SELECT "r"."R_REGIONKEY" AS "r.R_REGIONKEY","r"."R_NAME" AS "r.R_NAME","r"."R_COMMENT" AS "r.R_COMMENT"
FROM "TPCH_SF1"."REGION" AS "r"]; SQL state [XX000]; error code [200001]; 
JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: 
Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocator at 
net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:560).; 
nested exception is net.snowflake.client.jdbc.SnowflakeSQLException:
 JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError:
 Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocator at 
net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:560).

org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT "r"."R_REGIONKEY" AS "r.R_REGIONKEY","r"."R_NAME" AS "r.R_NAME","r"."R_COMMENT" AS "r.R_COMMENT"
FROM "TPCH_SF1"."REGION" AS "r"]; SQL state [XX000]; error code [200001]; JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocator at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:560).; nested exception is net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocator at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:560).
	at app//org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1542)
	at app//org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
	at app//org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:465)
	at app//org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:475)
@github-actions github-actions bot changed the title Execute query - error in new driver 3.13.18 SNOW-591937: Execute query - error in new driver 3.13.18 May 18, 2022
@sfc-gh-wfateem sfc-gh-wfateem self-assigned this Jun 1, 2022
@sfc-gh-wfateem
Copy link
Collaborator

Hi @r331,

My initial hunch here is that the underlying issue is related to the JDK compatibility issues that were reported previously, for example, #484 and #533. The JDBC driver version 3.10.3 is pretty old, and I believe the default resultset format used there was JSON. Once you upgrade to the later releases, Arrow format is used by default.

What JDK version are you using?

In case you're using JDK versions 15 or up, can you refer to the workaround mentioned here:
#533 (comment)

For JDK 17 use this:
#533 (comment)

The other thing you can do is force the result format to JSON by setting the following in your JDBC driver:
JDBC_QUERY_RESULT_FORMAT=JSON

You can set that in your URL string by adding:
&JDBC_QUERY_RESULT_FORMAT=JSON

@sfc-gh-wfateem
Copy link
Collaborator

Closing this as a duplicate of #533. Let me know if you have any questions @r331.

@sfc-gh-wfateem sfc-gh-wfateem closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants