0
0
Snowflakecloud~10 mins

File formats (CSV, JSON, Parquet, Avro) in Snowflake - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a CSV file into a Snowflake table.

Snowflake
COPY INTO my_table FROM @my_stage/file[1] FILE_FORMAT = (TYPE = 'CSV');
Drag options to blanks, or click blank then click option'
A.csv
B.json
C.parquet
D.avro
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong file extension like .json or .parquet for CSV files.
2fill in blank
medium

Complete the code to specify the JSON file format in Snowflake.

Snowflake
CREATE FILE FORMAT my_json_format TYPE = '[1]';
Drag options to blanks, or click blank then click option'
ACSV
BPARQUET
CJSON
DAVRO
Attempts:
3 left
💡 Hint
Common Mistakes
Using CSV or Parquet instead of JSON for JSON files.
3fill in blank
hard

Fix the error in the COPY INTO command to load Parquet files.

Snowflake
COPY INTO my_table FROM @my_stage/file[1] FILE_FORMAT = (TYPE = 'PARQUET');
Drag options to blanks, or click blank then click option'
A.parquet
B.json
C.avro
D.csv
Attempts:
3 left
💡 Hint
Common Mistakes
Using .csv or .json extensions when loading Parquet files.
4fill in blank
hard

Fill both blanks to create a file format for Avro files with compression.

Snowflake
CREATE FILE FORMAT avro_format TYPE = '[1]' COMPRESSION = '[2]';
Drag options to blanks, or click blank then click option'
AAVRO
BGZIP
CSNAPPY
DJSON
Attempts:
3 left
💡 Hint
Common Mistakes
Using JSON as file type for Avro or wrong compression types.
5fill in blank
hard

Fill all three blanks to create a Snowflake stage for Parquet files with auto compression detection.

Snowflake
CREATE STAGE my_stage FILE_FORMAT = (TYPE = '[1]' COMPRESSION = '[2]' AUTO_DETECT = [3]);
Drag options to blanks, or click blank then click option'
ACSV
BPARQUET
CTRUE
DAUTO
Attempts:
3 left
💡 Hint
Common Mistakes
Using CSV as the file type or setting an incorrect compression value for Parquet files.