from snowflake.snowpark import Session
from snowflake.snowpark.functions import col
# Create a new session, using the connection properties specified in a file.
new_session = Session.builder.configs(connection_parameters).create()
# Create a DataFrame that contains the id, name, and serial_number
# columns in the “sample_product_data” table.
df = session.table("sample_product_data").select(
col("id"), col("name"), col("name"), col("serial_number")
# Show the results
Develop Apps and Extensions
Write applications that extend Snowflake, act as a client, or act as an integrating component.
Run Python, Java, and Scala Code in Snowpark
Using Snowpark runtimes and libraries, you can securely deploy and process non-SQL code to build pipelines, ML models, and applications in Snowflake.
Enable all data users to bring their work to a single platform with native support for Python, Java, Scala, and more
Apply consistent controls trusted by over 500 of the Forbes Global 2000 across all workloads
Benefit from the Snowflake Data Cloud with super price/performance and near-zero maintenance
Code in Snowpark with multiple languages
Run custom Python, Java, or Scala code directly in Snowflake with Snowpark user-defined functions (UDFs) and stored procedures. There are no separate clusters to manage, scale, or operate.
Use the following quickstart tutorials to get a hands-on introduction to Snowpark.
Getting Started with Data Engineering and ML using Snowpark for Python
Follow this step-by-step guide to transform raw data into an interactive application using Python with Snowpark and Streamlit
Data Engineering Pipelines with Snowpark Python
Learn how to build end-to-end data engineering pipelines using Snowpark with Python
NATIVE APPS FRAMEWORK
Build secure data applications
Expand the capabilities of other Snowflake features by sharing data and related business logic with other Snowflake accounts.
Developing an Application with the Native Apps Framework
Follow this step-by-step tutorial to create a secure data application using the Native Apps Framework.
About the Native Apps Framework
Learn about the building blocks of the Native Apps Framework, including key terms and components.
Native Apps Framework Workflows
Understand the end-to-end workflows for developing, publishing, and using applications created using the Native Apps Framework.
STREAMLIT IN SNOWFLAKE
Develop custom web apps for machine learning and data science
Securely build, deploy, and share Streamlit apps on Snowflake’s data cloud.
Example - Accessing Snowflake data from Streamlit in Snowflake
Learn how to securely access Snowflake data from a Streamlit app.
FUNCTIONS AND PROCEDURES
Extend Snowflake capabilities
Enhance and extend Snowflake by writing procedures and user-defined functions. In both cases, you write the logic in one of the supported programming languages.
Stored Procedures or UDFs
Covers the key differences between stored procedures and UDFs, including differences in how each may be invoked and in what they may do
Perform scheduled or on-demand operations by executing code or SQL statements. You write logic in one of the supported programming languages
User-Defined Functions (UDFs)
Run logic to calculate and return data. UDFs are useful for batch processing and integrating custom logic into SQL. You write logic in one of the supported programming languages
Packaging Handler Code
Build a JAR file that contains the handler and its dependencies. When you create the function or procedure, you reference the handler JAR on a stage
Writing External Functions
A guide to writing external functions, with which you can invoke code on other systems
KAFKA AND SPARK CONNECTORS
Integrate with Other Systems
Snowflake includes connectors with APIs for integrating with systems outside Snowflake.
Integrate Snowflake with many other systems for exchanging data, performing analysis, and more
Build a Client App with Drivers and APIs
Integrate Snowflake operations into a client app. In addition to the Snowpark API, you can also use language and platform specific drivers.
Drivers allow you to connect from your code or apps to Snowflake. Using languages such as C#, Go, and Python, you can write applications that perform operations on Snowflake.
Using the Snowflake RESTful SQL API, you can access and update data over HTTPS and REST. For example, you can submit SQL statements, create and execute stored procedures, provision users, and so on.
In the SQL REST API, you submit a SQL statement for execution in the body of a POST request. You then check execution status and fetch results with GET requests.