All Collections
Data
Snowflake in Astrato
How Snowpark works in Astrato
How Snowpark works in Astrato

Astrato is snowpark compatible. Run dynamic forecast, clustering models, sentiment analysis and machine learning from Astrato.

K
Written by Konrad Mattheis
Updated over a week ago

Snowpark is a powerful feature from snowflake which combines the use of SQL and python, Java or Scala. This article focuses on how Snowpark can be used to enrich analytics and drive-confident decision-making.

Astrato can make use of user-defined functions, which can be used in SQL queries and views in Astrato. Once a function is created in Snowflake, it can be used in any query or view in the same schema, and use anywhere in Astrto.

What types of analysis can I achieve using Snowpark?

Any! As long as there is a python package and of course, data, to support your analysis. Combining Astrato writeback with Snowpark

Here are a few examples to get spark your creativity:

  • Forecasting

  • Clustering

  • Sentiment analysis

  • Machine learning

β„Ή Snowpark features cannot connect to the internet and are secure - this does mean that all data and python packages need to be in snowflake.

How do I write code for Snowpark?

Our very own Snowflake Data Superhero Piers Batchelor has created an AI code generator for Snowpark for Python. Read his blog to learn more and get free access to the tool.

<a href="https://medium.com/@piers.batchelor/building-a-snowpark-ready-python-udf-code-generator-for-snowflake-customers-681989e44b4b" target="_blank" rel="nofollow noopener noreferrer">https://medium.com/@piers.batchelor/building-a-snowpark-ready-python-udf-code-generator-for-snowflake-customers-681989e44b4b</a>

Example workbook featuring Snowpark & writeback

πŸ‘¨β€πŸ”¬ Click the link to try out this Snowpark workbook

πŸ“Ί Watch the recorded demo here on Astrato Live

Users of this workbook are planning marketing budgets for a campaign next week. They need to make sure the spend is fairly distributed - previous campaign results have been loaded and used to train a model.

Each time a model is run, scenarios are sent back to snowflake for easy retrieval using writeback. A model is run against them in real-time to understand what return on investment (ROI) may be achieved by the proposed budget allocation.

This model helps drive budgeting decisions. In this model, only a few steps need to occur to driver powerful analytics:

  1. Writeback to table

  2. Automatic Requery after successful writeback

  3. Python function runs against table

  4. Data is returned via a view containing the function

To re-create this in Snowflake, follow the guidance in this snowflake tutorial.

A gif of a snowpark workbook helping drive budgeting decisions.

Learn more about Snowpark

For more in-depth snowpark tutorials, navigate to the Snowflake documentation links below:

We'd love to hear how you are using Snowpark, let us know in Astrato Galaxy 🌌

Did this answer your question?