Welcome to this week’s Frosty Friday challenge! In this challenge, you’ll explore Snowflake’s powerful metadata and schema inference capabilities. Your task is to use INFER_SCHEMA
to extract metadata from a Parquet file in a stage and transform it into a Snowflake table.
By following a series of steps, you will go from querying the metadata of a staged file to creating a Snowflake table using the inferred schema. Can you connect the dots and complete the pipeline?
Using the INFER_SCHEMA and GENERATE_COLUMN_DESCRIPTION functions, as shown in the first image, your task is to:
- Query Metadata: Use the INFER_SCHEMA function to extract the metadata of a staged Parquet file. This metadata will include column names, data types, and file-level details.
- Transform Metadata: Generate a
CREATE TABLE
statement using the inferred metadata (as shown in the second image) to define the table structure.
Enjoy finding it and remember to post your code 🙂
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.