Java 17 now on Snowflake! (PuPr)

Snowpark now supports Java 17! This means you can start using Java 17’s programming interfaces and patterns in your UDFs, UDTFs, Stored Procedures, and in the Snowpark API. Creating a UDF or Stored Procedure with Java 17 is as easy as setting the RUNTIME_VERSION property on the object:

CREATE OR REPLACE FUNCTION echo_varchar(x varchar)
RETURNS VARCHAR
LANGUAGE JAVA
RUNTIME_VERSION = '17'
HANDLER='TestFunc.echoVarchar'
as
$$
class TestFunc {
public static String echoVarchar(String x) {
return x;
}
}
$$;

To learn more about Java runtimes on Snowflake, please see our Java Runtime Support Policy.

On the client side, the Snowpark API and Snowflake JDBC Driver support Java 17 as of versions 1.10.0 and 3.14.4 respectively. Java 17 support is in public preview on both the server and client, and as such there are a couple limitations:

  1. The Snowpark method to create UDFs and Stored Procedures do not yet support creating those objects with Java 17. Those methods will be updated in the following Snowpark client release.
  2. Apache Arrow connector still depends on some internal Java APIs, so you will need to set the parameter, --add-opens=java.base/java.nio=ALL-UNNAMED, when executing your Snowpark application. For example:
java --add-opens=java.base/java.nio=ALL-UNNAMED -jar my-snowpark-app.jar

--

--