Week 125 - Snowpark & Python

Snowflake's support for Jinja now includes imports - this means you can modularise your code, and use macros.

Your challenge is to create two scripts:

utils.sql:
Will contain a macro called power_of_two that meets the following requirements:

  1. Accepts a list of numbers
  2. For each number, returns:
    • The original number
    • The squared (two the power of two) number
  3. Unions all

main.sql:
Will be the file that simply calls the macro - it should use a simple list of `[1, 2, 3, 4]`

If all is correct, you ought to get a result like:

Happy Jinjaing!

Previous
Previous

Week 126 - Data Loading & Staging

Next
Next

Week 124 - Administration