Week 126 - Data Loading & Staging
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 TABLEstatement using the inferred metadata (as shown in the second image) to define the table structure.
Enjoy finding it and remember to post your code 🙂