-
Notifications
You must be signed in to change notification settings - Fork 167
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-340077: UnsupportedOperationException sun.misc.Unsafe or java.nio.DirectByteBuffer when running on JDK16 #484
Comments
Hi, this error seems to be caused by the Arrow library that we use as a dependency. As a workaround for now, could you try setting |
Hi, I'm having the same problem (also 3.13.2, but with Java 15). I did try setting -Dio.netty.tryReflectionSetAccessible=true but that did not help. |
@sfc-gh-mknister any updates on this ticket? I'm having same issue when running on spark I'm using:
I read data from Snowflake like this
I'm passing the
here is full stack trace when trying to read from Snowflake table
|
I am using Flyway (7.14.1) with Snowflake JDBC driver 3.13.7 and OpenJDK 16 getting this error: Caused by: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: JDBC driver internal error: Fail to retrieve row count for first arrow chunk: sun.misc.Unsafe or java.nio.DirectByteBuffer.(long, int) not available. I am passing -jdbcProperties.Dio.netty.tryReflectionSetAccessible=true per the suggestion above without success. |
@sfc-gh-dbryant in JDK16 you should pass |
Duplicate/related issue: |
I got it to work for |
@cloojure driver works fine on jdk11, this ticket about jdk16-17 issues |
@IRus Except I have the same problem -- or at least a very, very similar problem -- on jdk 15. |
Related #589 |
If anyone else is having issues with this, you could add this to your startup script as a workaround until this is solved
|
@apixandru this is brilliant thanks for sharing, can you explain why this would work though? I looked at the |
@dzlab io.netty.util.internal.PlatformDependent0 uses both unsafe and directbytebuffer as the error message indicates.
|
@apixandru I tried this workaround in spark by using the javaExtraOption (According to the Oracle JVM documentation, instead of using the the executor started with this java command (you can see
but in the executor when it tries to download the chunk it fails with the
|
To clean up and re-prioritize more pressing bugs and feature requests we are closing all issues older than 6 months as of March 1, 2023. If there are any issues or feature requests that you would like us to address, please create them according to the new templates we have created. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response. |
Hi!
Snowflake-jdbc version: 3.13.2
JDK version: openjdk:16-slim
I am observing following issue while trying to fetch data from Snowflake used jdbc/JDK versions above:
Could you please advice if there is any ETA to remove/replace
sun.misc.Unsafe
usage in favourVarhandle
etc? Assuming new JDK LTS is scheduled for September 2021, it would good to get rid ofUnsafe
usages for good.Thanks in advance!
The text was updated successfully, but these errors were encountered: