Creating Stored Procedures For DataFrames in Java - Snowflake Documentation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

4/29/24, 3:05 PM Creating stored procedures for DataFrames in Java | Snowflake Documentation

Developer Snowpark API Java Creating Stored Procedures


Creating stored procedures for
DataFrames in Java
PREVIEW FEATURE — OPEN
Preview support for this feature is available to all accounts.

Using the Snowpark API, you can create stored procedures for your custom lambda
expression in Java. You can call these stored procedures to process the data in
your DataFrame .
You can create:
Temporary stored procedures that exist only within the current session.
Permanent stored procedures that you can use in other sessions, including
from a Snowflake worksheet.
Creating a temporary stored procedure
You can create a temporary procedure that will last for the current session only.
The temporary procedure can be:
An anonymous procedure that you can call by reference, such as by passing a
variable of type com.snowflake.snowpark_java.StoredProcedure representing it
to code that calls the procedure.
A named procedure with a name you assign. You can call the procedure by
name from other code within the session.
To create a temporary procedure, you register it with one of the
registerTemporary methods of com.snowflake.snowpark_java.SProcRegistration.
The method is overloaded multiple times to support different numbers of procedure
arguments. To get an SProcRegistration instance, call the sproc method of the
com.snowflake.snowpark_java.Session class.
When calling registerTemporary , you can pass as arguments the following:
The procedure’s name (when it is a named procedure).
The procedure itself as a lambda expression.
Parameter data types as a single or array of
com snowflake snowpark java types DataType class Omit this argument
https://docs.snowflake.com/en/developer-guide/snowpark/java/creating-sprocs 1/1

You might also like