COF-C02 practice question 34 of 35

When unloading data, which file format preserves the data values for floating-point number columns?

Full set: 778 questions
Answer options
A: Avro
B: CSV
C: JSON
D: Parquet Correct answer
Correct Answer:
D. Parquet
Explanation

Parquet is a binary, columnar file format that stores data types in their native representation. When unloading data from Snowflake, Parquet preserves the exact precision of floating-point numbers (e.g., FLOAT, DOUBLE) without requiring explicit casting or special handling. Text-based formats like CSV and JSON convert numbers to their string representations, which can result in a loss of precision. Snowflake's official documentation explicitly recommends using the Parquet file format to ensure the fidelity of floating-point data during unloading operations.

Why Incorrect

A. Avro: While Avro is a binary format that can preserve precision, Snowflake's documentation specifically and prominently recommends Parquet for maintaining floating-point precision during unloading.
B. CSV: As a text-based format, CSV represents numbers as strings. This conversion process can lead to rounding or truncation, causing a loss of floating-point precision.
C. JSON: Similar to CSV, JSON is a text-based format. Unloading numeric data to JSON involves converting it to a string representation, which risks the loss of exact precision.

References

1. Snowflake Documentation: Preparing to Unload Data. Under the section Floating-point Numbers

the documentation states: "To preserve the exact precision of floating-point numbers when unloading data

we recommend using the Parquet file format. When unloading to other file formats (CSV

JSON

etc.)

if you need to preserve the precision of the floating-point numbers

we recommend explicitly casting the floating-point number columns to strings in the SELECT statement."

Link to Source

2. Snowflake Documentation: Summary of Data Type Mapping for Unloading. This table shows that Snowflake FLOAT data types are converted to Parquet DOUBLE (a native binary floating-point type)

whereas for CSV and JSON

they are converted to their string representations.

Link to Source

Scroll to Top