This week, we’re using a feature that, at the time of writing, is pretty hot off the press :
Python in Snowflake.
To start out create a simple table with a single column with a number, the size and amount are up to you,
After that we’ll start with a very basic function: multiply those numbers by 3.
The challenge here is not ‘build a very difficult python function’ but to build and use the function in Snowflake.
We can test the code with a simple select statement :
SELECT timesthree(start_int)
FROM FF_week_5
Remember if you want to participate:
- Sign up as a member of Frosty Friday. You can do this by clicking on the sidebar, and then going to ‘REGISTER‘ (note joining our mailing list does not give you a Frosty Friday account)
- Post your code to GitHub and make it publicly available (Check out our guide if you don’t know how to here)
- Post the URL in the comments of the challenge.
If you have any technical questions you’d like to pose to the community, you can ask here on our dedicated thread.
23 responses to “Week 5 – Basic”
-
I’ve just spent two weeks practicing making Python UDFs for a customer, so this was oddly the easiest challenge so far for me!
Solution URL: https://github.com/ChrisHastieIW/Frosty-Friday/blob/main/Week%205%20-%20Basic%20-%20UDFs/Week%205%20-%20Basic%20-%20UDFs.sql
-
Reorganised my submission repo, new master solution URL here.
- Solution URL – https://github.com/ChrisHastieIW/Frosty-Friday
-
-
I’m finding it very difficult to format answers in this comment box.
My approach:
1. Create a table with a single column2. Create a view querying that table that uses an udf
2.1. Use a pre-hook to create the udf needed in the view.
- Solution URL – https://github.com/dsmdavid/frostyfridays-sf/blob/main/models/challenge_05_01.sql
-
My knowledge of Python is minimum, probably need to invest a lot more to make the function more useful.
- Solution URL – https://github.com/zlzlzl2-data/FrostyFriday/blob/main/FF5_LZ.sql
-
Created 2 functions, basic SQL UDF and a Python one as well. In this case, a simple SQL one is simpler as you have less to define.
- Solution URL – https://github.com/ChrisBBiztory/FrostyFriday/blob/main/Week_5.sql
-
nuova maglia hellas verona 2022
Week 5 – Basic
-
My solution for week 5
- Solution URL – https://github.com/isarenz/FrostyFridayChallenges/blob/main/FrostyFriday_Challenge_Week5.sql
-
Check out Challenge 5 blog: https://theinformationlab.nl/en/2022/09/21/python-udfs-in-snowflake/
- Solution URL – https://github.com/Atzmonky/snowflake/blob/main/ch_5_UDFs.sql
-
This was fast one to finish just by using Snowflake docs to get the create function syntax right!
- Solution URL – https://github.com/pekka-kanerva/frosty-friday/blob/main/week5/ff-week5-solution.sql
-
Here’s my solution, which the docs made very easy!
- Solution URL – https://github.com/apd-jlaird/frosty-friday/blob/main/week_5/ff_week_5.sql
-
Nice little intro, wasn’t aware you could do this is snowflake. My Solution ^
- Solution URL – https://github.com/BenAConnor/Frosty_Friday/blob/main/Week%205%20Solution.sql
-
Solution
- Solution URL – https://github.com/jameskalfox/frosty-friday-snowflake-challenges/blob/main/Week_05.sql
-
Lovely!
- Solution URL – https://github.com/canonicalized/FrostyFriday/blob/main/WEEK5.sql
-
Nice!!
- Solution URL – https://github.com/arjansnowflake/Frosty_Friday/blob/main/Week_5/week_5.sql
-
Noice
- Solution URL – https://github.com/NMangera/frosty_friday/blob/main/wk%205%20-%20basic%20/UDFs
-
Used the `GENERATOR()` table function with the `ROW_NUMBER()` window function for a dynamic amount of test data!
https://github.com/marioveld/frosty_friday/tree/main/ffw5
- Solution URL – https://github.com/marioveld/frosty_friday/tree/main/ffw5
-
🙂
- Solution URL – https://github.com/darylkit/Frosty_Friday/blob/main/Week%205%20-%20UDF/udf.sql
-
I created SQL&Python Function.
and Used the `GENERATOR()` for Test Data.- Solution URL – https://github.com/tomoWakamatsu/FrostyFriday/blob/main/FrostyFriday-Week5.sql
-
This is my version of the solution for this task. I hope you find it helpful! ^^
- Solution URL – https://github.com/GerganaAK/FrostyFridays/blob/main/Week%205%20%E2%80%93%20Basic
Leave a Reply
You must be logged in to post a comment.