Source
Introduction to Java UDFs
When a user calls a UDF, the user passes UDF’s name and arguments to Snowflake. Snowflake calls the associated handler code (with arguments, if any) to execute the UDF’s logic. The handler method then returns the output to Snowflake,…
Creating a Java UDF handler
When you write a Java UDF, you write Java code for Snowflake to execute as UDF logic. This Java code is the UDF’s handler. You deploy the UDF with CREATE FUNCTION, giving the UDF a name and specifying the Java method as the handler to…
Java requirements for the JDBC Driver
The Snowflake JDBC driver requires Java LTS (Long - Term Support) versions 1.8 or higher. If the minimum required version of Java is not installed on the client machines where the JDBC driver is installed, you must install either Oracle Java…
Analyzing queries and troubleshooting with Snowpark Java
To inspect the evaluation plan of a DataFrame, call the explain method of the DataFrame. This prints the SQL statements used to evaluate the DataFrame. If there is only one SQL statement, the method also prints the logical plan for the…
Java UDF handler examples
This code returns the VARCHAR passed to it. This function is declared with the optional CALLED ON NULL INPUT clause to indicate that the function is called even if the value of the input is NULL.
Python and Java support for serverless tasks
Serverless tasks can invoke the following object types and functions: user - defined functions (UDFs) and stored procedures written in Python, Java, and Scala. You can use Python or Java in your tasks in a few different ways.
JDBC connections requiring a proxy generate 'Encountered exception (connect timed out) during upload' exceptions for PUT operations using downscoped tokens
JDBC connections requiring a proxy generate 'Encountered exception (connect timed out) during upload'…
JDBC driver with -Dhttp.nonProxyHosts=* set throws java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1
ISSUE: When using the JDBC driver's diagnostics feature (i.e., ENABLE_DIAGNOSTICS=TRUE)1, if the -Dhttp.nonProxyHosts=* JVM argument is set, the following exception can occur on some Java versions: java.lang.RuntimeException: java.lang.St…
JDBC Driver Compatibility Issue With JDK 16 and Later: Exception creating result java.lang.ExceptionInInitializerError at net.snowflake.client.jdbc.internal.apache.arrow.memory.UnsafeAllocationManager
CAUSE: The failure is directly caused by one of the JDBC driver's dependencies, Apache Arrow, when attempting to use reflection in order to access a private member of the java.nio.Buffer class. This was allowed by Java previously, but not…
Key pair authentication failure due to ObjectIdentifier() or SecretKeyFactory not available errors
ISSUE: Customers using the Snowflake JDBC driver using key pair authentication with encrypted private keys may see the following fatal error signature(s) thrown by the Java application during authentication: Private key provided is invalid…