cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC driver uses Unsafe API, which will be completely deprecated in a future release of Java

benesq
New Contributor

Using JDBC driver (2.7.3) in OpenJDK 24 gives the following warning:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by com.databricks.client.jdbc42.internal.apache.arrow.memory.util.MemoryUtil
WARNING: Please consider reporting this to the maintainers of class com.databricks.client.jdbc42.internal.apache.arrow.memory.util.MemoryUtil
WARNING: sun.misc.Unsafe::arrayBaseOffset will be removed in a future release

While it's uncertain what Java release it will be deprecated in, I think this needs to be fixed sooner rather than later. Java's new FFM API provides a nice way of handling Off-Heap memory and probably would fix whatever this MemoryUtil class is trying to do in a safe way. There are also other alternatives.

Thanks,

Ben

1 REPLY 1

NandiniN
Databricks Employee
Databricks Employee

Hey @benesq , 

For JDBC driver 2.7.4 https://www.databricks.com/spark/jdbc-drivers-download should be used with

Java Runtime Environment (JRE) 8.0, 11.0 or 21.0. As mentioned in the installation doc "Each machine where you use the Databricks JDBC Driver must have Java Runtime Environment (JRE) 8.0, 11.0 or 21.0."

This will be fixed in a subsequent version of JavaFX side, https://bugs.openjdk.org/browse/JDK-8345121 does mention the issue is now resolved.

 Thanks!

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now