Week 53 – Intermediate

One of the quieter releases into public preview is that we can now infer schemas for CSVs. To test this follow the following instructions:

  1. Create an internal stage

    create stage frosty_stage;
  2. Create a csv file format
    create or replace file format frosty_csv
    field_optionally_enclosed_by = '"'
    skip_header = 1;

  3. PUT the following csv file into that internal stage. Download Here

Now you need to infer the schema and produce the following:

Remember, if you want to participate:

  1. Sign up as a member of Frosty Friday. You can do this by clicking on the sidebar, and then going to ‘REGISTER
  2. Post your code to GitHub and make it publicly available (Check out our guide if you don’t know how to here)
  3. Post the URL in the comments of the challenge

3 responses to “Week 53 – Intermediate”

  1. ChrisHastie avatar

    Another week, more fun. Cheers

    • Solution URL – https://github.com/ChrisHastieIW/Frosty-Friday
  2. canonicalized avatar

    I actually went on to create the table with the inferred schema and loaded the data by parsing the csv header

    • Solution URL – https://github.com/canonicalized/FrostyFriday/blob/main/WEEK53.sql
  3. dsmdavid avatar

    thanks for the challenge — had to `put` the file outside my solution, but good to explore these new functionalities (also useful to combina with other metadata functions!)

    • Solution URL – https://github.com/dsmdavid/frostyfridays-sf/blob/main/models/challenge_53.sql

Leave a Reply