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
df.show()
Develop Apps and Extensions
Write applications that extend Snowflake, act as a client, or act as an integrating component.
SNOWPARK API
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.
Build
Enable all data users to bring their work to a single platform with native support for Python, Java, Scala, and more.
Secure
Apply consistent controls trusted by over 500 of the Forbes Global 2000 across all workloads.
Optimize
Benefit from the Snowflake Data Cloud with super price/performance and near-zero maintenance.
Get to know Snowpark API
Snowpark is the set of libraries and runtimes in Snowflake that enable developers to securely process non-SQL code, including Python, Java, and Scala, without data movement in Snowflake’s elastic processing engine.
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.
Try Snowpark
Use the following quickstart tutorials to get a hands-on introduction to Snowpark
Snowpark ML
Train, manage, and deploy machine learning models
Pre-process data and train, manage, and deploy machine learning models all within Snowflake.
Snowflake Python API
Manage Snowflake resources, apps, and data pipelines
Create and manage Snowflake resources across data engineering, Snowpark, Snowpark ML, and application workloads using a unified, first-class Python API.
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.
SNOWPARK CONTAINER SERVICES
Deploy, manage, and scale containerized applications
Build atop a fully-managed service that comes with Snowflake security, configuration, and operational best practices built in.
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.
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.
KAFKA AND SPARK CONNECTORS
Integrate with Other Systems
Snowflake includes connectors with APIs for integrating with systems outside Snowflake.
DRIVERS
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
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.
RESTful API
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.
TOOLS
Develop more efficiently
Work with Snowflake using tools that integrate well with your existing workflow.
Work with Snowflake from the command line
Use the command line to create, manage, update, and view apps running on Snowflake across workloads.
Use Git from Snowflake
Execute and use Git repository code directly from Snowflake.