Domain: Snowflake Features & Architecture
· 561 words · 10 min read

Snowpark and Streamlit

Overview

While Snowflake started as a SQL-based data warehouse, it has evolved into a full programmable data cloud. Snowpark and Streamlit in Snowflake are the two primary frameworks that allow developers and data scientists to write code in non-SQL languages (Python, Java, Scala) and build applications directly within the Snowflake environment.

Key Concepts: Snowpark

Snowpark is a developer framework that brings deep integration of Python, Java, and Scala into Snowflake.

The Snowpark API (DataFrames)

Serverless Execution (UDFs and Stored Procedures)

Snowpark allows you to upload custom Python, Java, or Scala code and run it directly inside Snowflake's secure boundary.

Snowpark-Optimized Warehouses

Standard virtual warehouses are optimized for SQL. For heavy machine learning training or complex Python data processing that requires massive amounts of memory, you can use a Snowpark-optimized warehouse. They provide up to 16x the memory per node compared to standard warehouses and consume 1.5x more credits per hour.

Key Concepts: Streamlit in Snowflake

Streamlit is an open-source Python library that makes it easy to build custom web apps for machine learning and data science. Snowflake acquired Streamlit and integrated it natively.

Architecture Visualized


Developer Machine (Python/VS Code)
      │
      ▼ (Snowpark DataFrame API translates to SQL)
      │
Snowflake Cloud Services Layer (Parses & Optimizes)
      │
      ▼ (Executes Pushdown SQL & Python UDFs)
      │
Snowflake Compute Layer (Virtual Warehouses)

Python Example (Conceptual)


# A simple Snowpark Python example showing DataFrame usage
from snowflake.snowpark import Session

# Connect to Snowflake
session = Session.builder.configs(connection_parameters).create()

# Read a table into a Snowpark DataFrame
df = session.table("sales_data")

# Filter and aggregate using Python syntax (executed as SQL in Snowflake)
summary_df = df.filter(df["region"] == "US").group_by("category").count()

# Show results
summary_df.show()

Exam Tips

⚠️ Crucial for COF-C03:

Key Takeaways