One of the quieter releases into public preview is that we can now infer schemas for CSVs. To test this follow the following instructions:
- Create an internal stage
create stage frosty_stage;
- Create a csv file format
create or replace file format frosty_csv
field_optionally_enclosed_by = '"'
skip_header = 1; - 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:
- Sign up as a member of Frosty Friday. You can do this by clicking on the sidebar, and then going to ‘REGISTER‘
- 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
3 responses to “Week 53 – Intermediate”
-
Another week, more fun. Cheers
- Solution URL – https://github.com/ChrisHastieIW/Frosty-Friday
-
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
-
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
You must be logged in to post a comment.