Introduction
Sometimes you need to create your own small programs inside your database to reuse logic easily. User-defined functions with Snowpark let you write these programs in Python and run them close to your data in Snowflake.
When you want to reuse a calculation or transformation on your data multiple times without rewriting it.
When you need to run custom Python code on your data inside Snowflake for better performance.
When you want to keep your data logic centralized and easy to update.
When you want to avoid moving large data sets outside Snowflake for processing.
When you want to combine SQL and Python logic seamlessly in your queries.