From the course: Snowpark for Data Engineers
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Creating anonymous UDFs in Snowpark - Snowflake Tutorial
From the course: Snowpark for Data Engineers
Creating anonymous UDFs in Snowpark
- [Instructor] User defined functions or UDFs in Snowflake are custom functions created by users to perform specific operations that are not available via built-in functions. Most data warehouses support creating UDFs using SQL queries. Snowflake allows you to use Snowpark APIs to create and register UDFs that you can use from within Python code as well as from within your SQL queries. Snowflake supports two types of UDFs, an anonymous UDF or a named UDF. An anonymous UDF is essentially a function that you assign to a variable. As long as this variable is in scope, you can use this variable to invoke the UDF. We'll first see how anonymous UDFs work before we move on to named UDFs. Here within my Python worksheet, I've set up a Snowpark handler that is the main function, which takes in a session as an input argument. On line eight, I've used the UDF function to register a UDF. This function creates a UDF by taking in a reference to a Python function or to a lambda. I've specified a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
UDFS, UDTFs, and Stored procedures4m 39s
-
(Locked)
Creating anonymous UDFs in Snowpark4m 16s
-
(Locked)
Creating named UDFs in Snowpark3m 21s
-
(Locked)
Accessing external packages in AUDF2m 18s
-
(Locked)
Understanding temporary UDFs5m 55s
-
(Locked)
Creating and invoking permanent UDFs2m 53s
-
(Locked)
-
-
-