snowflakedb / snowflake-jdbc

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

Version 3.13.33 throws NoClassDefFoundError when retrieving data #1442

Closed koettert closed 1 year ago

koettert commented 1 year ago

This might be related to https://github.com/snowflakedb/snowflake-jdbc/issues/589 but I'm not sure since it is working as expected with 3.13.32 and only failing with 3.13.33. Might work with 3.13.32 since we add the flag --add-opens=java.base/sun.nio=ALL-UNNAMED to our application. For more details you can also have a look at the post in our forum.

  1. What version of JDBC driver are you using? Affected version: 3.13.33 Unaffected version: 3.13.32 and older e.g. 3.13.24

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

  3. What version of Java are you using? JDK17

  4. What did you do? Connecting to database works but retrieving data results in the following stacktrace:

Caused by: 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:591).
    at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:291)
    at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.impl.monitored.MonitoredStatement.executeQuery(MonitoredStatement.java:81)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.agent.metadata.impl.DefaultDBMetadataReader.getDBDataObject(DefaultDBMetadataReader.java:381)
    at org.knime.database.node.utility.tableselector.DBTableSelectNodeModel.createDBDataObject(DBTableSelectNodeModel.java:278)
    at org.knime.database.node.utility.tableselector.DBTableSelectNodeModel.lambda$0(DBTableSelectNodeModel.java:204)
    at org.knime.database.port.DBDataPortObjectSpec.create(DBDataPortObjectSpec.java:128)
  1. What did you expect to see? The data :-) Executing the exact same operations using version 3.13.32 returns the expected result.

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

See stacktrace above.

sfc-gh-spanaite commented 1 year ago

Can you try as a workaround this before executing the query:

statement.execute("ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON';");

this is most probably related to the Arrow resultset format but I want to understand if the workaround works for you.

koettert commented 1 year ago

Yes as reported in the linked forum post executing the statement or setting the JDBC_QUERY_RESULT_FORMAT with value JSON solved the issue.

sfc-gh-spanaite commented 1 year ago

Thanks for confirming @koettert, I was expecting it to work with JSON result format. I cannot completely reproduce your issue as when using Windows 10 and JDK17 I get the following stacktrace:

Jun 26, 2023 3:52:17 PM net.snowflake.client.core.SFStatement executeQueryInternal
SEVERE: Exception creating result
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator.<clinit>(BaseAllocator.java:46)
        at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:591)
        at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:490)
        at net.snowflake.client.core.SFResultSetFactory.getResultSet(SFResultSetFactory.java:34)
        at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:227)
        at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:133)
        at net.snowflake.client.core.SFStatement.execute(SFStatement.java:767)
        at net.snowflake.client.core.SFStatement.execute(SFStatement.java:676)
        at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:274)
        at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
        at GithubIssue1442.main(GithubIssue1442.java:42)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:419)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:132)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 18 more

Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator.<clinit>(BaseAllocator.java:46).
        at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:291)
        at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
        at GithubIssue1442.main(GithubIssue1442.java:42)

Is there a chance you enable logging so I can see the log file? It works without issues in 3.13.32 indeed.

koettert commented 1 year ago

I enabled JDBC logging and this is an extract from the log file without the sensitive information

2023-06-28 14:44:08.122 n.s.c.core.StmtUtil FINE pollForOutput:518 - Returning result
2023-06-28 14:44:08.122 n.s.c.core.SFStatement FINE executeHelper:531 - Returning from executeHelper
2023-06-28 14:44:08.122 n.s.c.core.SFStatement FINE executeQueryInternal:223 - Creating result set
2023-06-28 14:44:08.122 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:512 - Entering create()
2023-06-28 14:44:08.122 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:549 - query id: 01ad4574-3201-d464-0000-49210214546e
2023-06-28 14:44:08.122 n.s.c.core.QueryContextCache FINE clearCache:140 - clearCache() called
2023-06-28 14:44:08.123 n.s.c.core.QueryContextCache FINE clearCache:144 - clearCache() returns. Number of entries in cache now 0
2023-06-28 14:44:08.123 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_PREFETCH_THREADS: 4
2023-06-28 14:44:08.123 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIMESTAMP_OUTPUT_FORMAT: YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM
2023-06-28 14:44:08.123 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIME_OUTPUT_FORMAT: HH24:MI:SS
2023-06-28 14:44:08.123 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIMESTAMP_TZ_OUTPUT_FORMAT: 
2023-06-28 14:44:08.123 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_RESULT_CHUNK_SIZE: 48
2023-06-28 14:44:08.124 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_SESSION_KEEP_ALIVE: false
2023-06-28 14:44:08.124 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_RS_COLUMN_CASE_INSENSITIVE: false
2023-06-28 14:44:08.124 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: SNOWPARK_HIDE_INTERNAL_ALIAS
2023-06-28 14:44:08.124 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter SNOWPARK_HIDE_INTERNAL_ALIAS: true
2023-06-28 14:44:08.124 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_CONSERVATIVE_MEMORY_ADJUST_STEP
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_CONSERVATIVE_MEMORY_ADJUST_STEP: 64
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_METADATA_USE_SESSION_DATABASE: false
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: QUERY_CONTEXT_CACHE_SIZE
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter QUERY_CONTEXT_CACHE_SIZE: 5
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_ENABLE_COMBINED_DESCRIBE: false
2023-06-28 14:44:08.125 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter ENABLE_STAGE_S3_PRIVATELINK_FOR_US_EAST_1: false
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_TREAT_DECIMAL_AS_INT: true
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIMESTAMP_NTZ_OUTPUT_FORMAT: YYYY-MM-DD HH24:MI:SS.FF3
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_RESULT_PREFETCH_THREADS
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_RESULT_PREFETCH_THREADS: 1
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX: false
2023-06-28 14:44:08.126 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_HONOR_CLIENT_TZ_FOR_TIMESTAMP_NTZ: true
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_MEMORY_LIMIT: 1536
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_EFFICIENT_CHUNK_STORAGE: true
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_TIMESTAMP_TYPE_MAPPING: TIMESTAMP_LTZ
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIMEZONE: America/Los_Angeles
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: SNOWPARK_REQUEST_TIMEOUT_IN_SECONDS
2023-06-28 14:44:08.127 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter SNOWPARK_REQUEST_TIMEOUT_IN_SECONDS: 86400
2023-06-28 14:44:08.128 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_RESULT_PREFETCH_SLOTS
2023-06-28 14:44:08.128 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_RESULT_PREFETCH_SLOTS: 2
2023-06-28 14:44:08.128 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_DISABLE_INCIDENTS: true
2023-06-28 14:44:08.128 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter BINARY_OUTPUT_FORMAT: HEX
2023-06-28 14:44:08.128 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CSV_TIMESTAMP_FORMAT
2023-06-28 14:44:08.129 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CSV_TIMESTAMP_FORMAT: 
2023-06-28 14:44:08.129 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_ENABLE_CONSERVATIVE_MEMORY_USAGE: true
2023-06-28 14:44:08.129 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_TELEMETRY_SESSIONLESS_ENABLED
2023-06-28 14:44:08.129 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_TELEMETRY_SESSIONLESS_ENABLED: true
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_FORCE_PROTECT_ID_TOKEN
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_FORCE_PROTECT_ID_TOKEN: true
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_FORMAT_DATE_WITH_TIMEZONE: true
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter DATE_OUTPUT_FORMAT: YYYY-MM-DD
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_CONSENT_CACHE_ID_TOKEN
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_CONSENT_CACHE_ID_TOKEN: false
2023-06-28 14:44:08.130 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter SNOWPARK_LAZY_ANALYSIS: true
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_USE_JSON_PARSER: true
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY: 3600
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter AUTOCOMMIT: true
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_SESSION_CLONE
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_SESSION_CLONE: false
2023-06-28 14:44:08.131 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter TIMESTAMP_LTZ_OUTPUT_FORMAT: 
2023-06-28 14:44:08.132 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_USE_SESSION_TIMEZONE: true
2023-06-28 14:44:08.132 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_TREAT_TIMESTAMP_NTZ_AS_UTC: false
2023-06-28 14:44:08.132 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: JDBC_EXECUTE_RETURN_COUNT_FOR_DML
2023-06-28 14:44:08.132 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter JDBC_EXECUTE_RETURN_COUNT_FOR_DML: false
2023-06-28 14:44:08.133 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_OUT_OF_BAND_TELEMETRY_ENABLED: false
2023-06-28 14:44:08.133 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: SNOWPARK_USE_SCOPED_TEMP_OBJECTS
2023-06-28 14:44:08.133 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter SNOWPARK_USE_SCOPED_TEMP_OBJECTS: false
2023-06-28 14:44:08.133 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_TELEMETRY_ENABLED: true
2023-06-28 14:44:08.133 n.s.c.core.SessionUtil FINE getCommonParams:1407 - Unknown Common Parameter: CLIENT_USE_V1_QUERY_API
2023-06-28 14:44:08.134 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_USE_V1_QUERY_API: true
2023-06-28 14:44:08.134 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_RESULT_COLUMN_CASE_INSENSITIVE: false
2023-06-28 14:44:08.134 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_ENABLE_LOG_INFO_STATEMENT_PARAMETERS: false
2023-06-28 14:44:08.134 n.s.c.core.SessionUtil FINE getCommonParams:1410 - Parameter CLIENT_STAGE_ARRAY_BINDING_THRESHOLD: 65280
2023-06-28 14:44:08.134 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_CUSTKEY,typeName=NUMBER,type=-5,nullable=false,length=0,precision=38,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.135 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_NAME,typeName=VARCHAR,type=12,nullable=false,length=25,precision=0,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.135 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_ADDRESS,typeName=VARCHAR,type=12,nullable=false,length=40,precision=0,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.135 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_NATIONKEY,typeName=NUMBER,type=-5,nullable=false,length=0,precision=38,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.135 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_PHONE,typeName=VARCHAR,type=12,nullable=false,length=15,precision=0,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.135 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_ACCTBAL,typeName=NUMBER,type=3,nullable=false,length=0,precision=12,scale=2,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.136 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_MKTSEGMENT,typeName=VARCHAR,type=12,nullable=true,length=10,precision=0,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.136 n.s.c.jdbc.SnowflakeResultSetSerializableV1 FINE create:582 - Get column metadata: name=C_COMMENT,typeName=VARCHAR,type=12,nullable=true,length=117,precision=0,scale=0,fixed=false,database=,schema=,table=SYS$_VIEW_11,isAutoIncrement=false
2023-06-28 14:44:08.136 n.s.c.core.SFStatement SEVERE executeQueryInternal:254 - Exception creating result
2023-06-28 14:44:08.137 n.s.c.jdbc.SnowflakeSQLException FINE <init>:110 - Snowflake exception: 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:591).
2023-06-28 14:44:08.137 n.s.c.jdbc.SnowflakeStatementV1 FINE close:908 - close()
2023-06-28 14:44:08.137 n.s.c.core.SFStatement FINE close:799 - public void close()
2023-06-28 14:44:08.137 n.s.c.jdbc.SnowflakeConnectionV1 FINE isClosed:238 -  public boolean isClosed()
2023-06-28 14:44:08.137 n.s.c.jdbc.SnowflakeConnectionV1 FINE isClosed:238 -  public boolean isClosed()
2023-06-28 14:44:08.137 n.s.c.jdbc.SnowflakeStatementV1 FINE isClosed:753 - isClosed()
2023-06-28 14:44:08.138 n.s.c.jdbc.SnowflakeStatementV1 FINE close:908 - close()
2023-06-28 14:44:08.138 n.s.c.core.SFStatement FINE close:799 - public void close()

This is the full stacktrace from within our application:

org.knime.core.node.InvalidSettingsException: 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:591).
    at org.knime.database.port.DBDataPortObjectSpec.create(DBDataPortObjectSpec.java:141)
    at org.knime.database.node.utility.tableselector.DBTableSelectNodeModel.configure(DBTableSelectNodeModel.java:202)
    at org.knime.core.node.NodeModel.configureModel(NodeModel.java:1078)
    at org.knime.core.node.Node.invokeNodeModelConfigure(Node.java:2007)
    at org.knime.core.node.Node.configure(Node.java:1943)
    at org.knime.core.node.workflow.NativeNodeContainer.performConfigure(NativeNodeContainer.java:566)
    at org.knime.core.node.workflow.SingleNodeContainer.callNodeConfigure(SingleNodeContainer.java:315)
    at org.knime.core.node.workflow.SingleNodeContainer.configure(SingleNodeContainer.java:200)
    at org.knime.core.node.workflow.WorkflowManager.configureSingleNodeContainer(WorkflowManager.java:6540)
    at org.knime.core.node.workflow.WorkflowManager.configureNodeAndPortSuccessors(WorkflowManager.java:6699)
    at org.knime.core.node.workflow.WorkflowManager.configureNodeAndSuccessors(WorkflowManager.java:6642)
    at org.knime.core.node.workflow.WorkflowManager.loadNodeSettings(WorkflowManager.java:2066)
    at org.knime.core.node.workflow.NodeContainer.applySettingsFromDialog(NodeContainer.java:1140)
    at org.knime.core.ui.wrapper.NodeContainerWrapper.applySettingsFromDialog(NodeContainerWrapper.java:264)
    at org.knime.workbench.ui.wrapper.WrappedNodeDialog.callApplySettingsFromDialog(WrappedNodeDialog.java:672)
    at org.knime.workbench.ui.wrapper.WrappedNodeDialog.doApply(WrappedNodeDialog.java:644)
    at org.knime.workbench.ui.wrapper.WrappedNodeDialog.doOK(WrappedNodeDialog.java:559)
    at org.knime.workbench.ui.wrapper.WrappedNodeDialog$5.widgetSelected(WrappedNodeDialog.java:495)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at org.knime.workbench.ui.wrapper.WrappedNodeDialog.open(WrappedNodeDialog.java:199)
    at org.knime.workbench.editor2.editparts.NodeContainerEditPart.openDialog(NodeContainerEditPart.java:957)
    at org.knime.workbench.editor2.editparts.NodeContainerEditPart.openNodeDialog(NodeContainerEditPart.java:864)
    at org.knime.workbench.editor2.editparts.NodeContainerEditPart.openNodeDialog(NodeContainerEditPart.java:846)
    at org.knime.workbench.editor2.editparts.NodeContainerEditPart.openDialog(NodeContainerEditPart.java:835)
    at org.knime.workbench.editor2.editparts.NodeContainerEditPart.performRequest(NodeContainerEditPart.java:399)
    at org.eclipse.gef.tools.SelectEditPartTracker.performOpen(SelectEditPartTracker.java:194)
    at org.eclipse.gef.tools.SelectEditPartTracker.handleDoubleClick(SelectEditPartTracker.java:137)
    at org.knime.workbench.editor2.WorkflowSelectionDragEditPartsTracker.handleDoubleClick(WorkflowSelectionDragEditPartsTracker.java:126)
    at org.eclipse.gef.tools.AbstractTool.mouseDoubleClick(AbstractTool.java:1069)
    at org.eclipse.gef.tools.SelectionTool.mouseDoubleClick(SelectionTool.java:527)
    at org.eclipse.gef.EditDomain.mouseDoubleClick(EditDomain.java:231)
    at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseDoubleClicked(DomainEventDispatcher.java:291)
    at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDoubleClick(LightweightSystem.java:518)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:200)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
    at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:191)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: 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:591).
    at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:291)
    at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.connection.impl.monitored.MonitoredStatement.executeQuery(MonitoredStatement.java:81)
    at org.knime.database.connection.wrappers.AbstractStatementWrapper.executeQuery(AbstractStatementWrapper.java:92)
    at org.knime.database.agent.metadata.impl.DefaultDBMetadataReader.getDBDataObject(DefaultDBMetadataReader.java:381)
    at org.knime.database.node.utility.tableselector.DBTableSelectNodeModel.createDBDataObject(DBTableSelectNodeModel.java:278)
    at org.knime.database.node.utility.tableselector.DBTableSelectNodeModel.lambda$0(DBTableSelectNodeModel.java:204)
    at org.knime.database.port.DBDataPortObjectSpec.create(DBDataPortObjectSpec.java:128)
    ... 66 more
sfc-gh-spanaite commented 1 year ago

Hi @koettert , thanks for the additional information. To overcome this issue I've added slf4j jar (that issue is now being also investigated) and also --add-opens=java.base/java.nio=ALL-UNNAMED using:

> java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

on a Windows 10 VM and I am not able to reproduce this issue. Is there anything else from your environment that I need to be aware of?

filipelautert commented 1 year ago

Hello @sfc-gh-spanaite ! We are facing the same problem with Liquibase builds when upgrading to Snowflake jdbc driver 3.13.33 and Java 11 . I can see RootAllocatorat net\snowflake\client\jdbc\internal\apache\arrow\memory on snowflake jar file but I've the same issue: java.lang.NoClassDefFoundError: Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocator

It happens at SnowflakeResultSetSerializableV1:591: (resultSetSerializable.rootAllocator = new RootAllocator(Long.MAX_VALUE);

On 3.13.32 the same piece of code works, so maybe it's related to some dependencies version change or build issues?

Btw, for me it fails with java 8 and 11 but works fine with 17 and 20.

sfc-gh-spanaite commented 1 year ago

Hello @filipelautert @koettert I am able to reproduce the issue using DBeaver. Fails in 3.13.33 but works fine in 3.13.32. Give us some time to verify what's happening and we will come back with some updates.

sfc-gh-spanaite commented 1 year ago

I'm closing this issue as this should be fixed within the new release after [PR1474(]https://github.com/snowflakedb/snowflake-jdbc/pull/1474). We confirmed with reproduction and fix.