BigData / Apache Parquet Interview Questions
How do you load Parquet files into Snowflake?
Snowflake can query and load Parquet files staged in cloud storage using a two-step approach:
Step 1 — Stage the files (S3, Azure Blob, or GCS external stage):
CREATE OR REPLACE STAGE my_stage URL = 's3://my-bucket/parquet-data/' CREDENTIALS = (AWS_KEY_ID='...' AWS_SECRET_KEY='...');
Step 2a — Infer schema and query directly (no table creation needed):
SELECT $1:user_id::INT, $1:revenue::FLOAT FROM @my_stage (FILE_FORMAT => 'parquet_fmt');
Step 2b — Use INFER_SCHEMA to auto-create table:
CREATE TABLE events USING TEMPLATE ( SELECT ARRAY_AGG(OBJECT_CONSTRUCT(*)) FROM TABLE(INFER_SCHEMA( LOCATION => '@my_stage', FILE_FORMAT => 'parquet_fmt' )) ); COPY INTO events FROM @my_stage FILE_FORMAT = (TYPE = 'PARQUET');
INFER_SCHEMA reads the Parquet footer metadata to derive column names and types automatically, eliminating manual DDL.
More Related questions...