Skip to content
BENIBIX Learn

Snowpark

Also known as Snowflake Snowpark, Snowpark Python, Snowpark API

Code you write in Python or Java that runs in Snowflake.

Think of it like

It is like sending your recipe to the farm. The cooking happens where the food grows.

Example

A data scientist cleans 50 million rows with Snowpark Python. The work runs in Snowflake. Only a short summary comes back to her laptop.

Why it matters

Python users can work on big tables without moving them. That is faster and safer than a download.

Definition

Snowpark is a set of Snowflake libraries for working with data in Python, Java or Scala instead of SQL. You write DataFrame code, and Snowpark turns it into work that runs inside Snowflake. The data never has to come down to your laptop. Nothing runs until you ask for a result, such as a count. Your own functions can be sent up to run next to the data too.

Example code

python
df = session.table("orders").filter(col("amount") > 100)
df.count()
The filter runs inside Snowflake. Only the count comes back.
Snowpark code runs in one of the compute boxes on the right, next to the shared data.

Common mistake

Calling to_pandas on a huge table. That pulls every row down to your machine, which is what Snowpark is there to avoid.

Key takeaways

  1. 1
    DataFrames. Python, Java or Scala, not SQL.
  2. 2
    Runs in Snowflake. The data stays where it is.
  3. 3
    Lazy. Nothing runs until you ask.