SOL-C01 practice question 21 of 30

Which data type in Snowflake is commonly used for storing semi-structured data?

Full set: 214 questions
Answer options
A: BLOB
B: JSON
C: VARIANT Correct answer
D: VARCHAR
Correct Answer:
C. VARIANT
Explanation

The VARIANT data type is Snowflake's universal type designed specifically for storing and querying semi-structured data. It can natively ingest formats like JSON, Avro, ORC, Parquet, and XML without requiring a predefined schema. This allows for flexible data loading and direct querying of the hierarchical structure within the data, making it the most common and powerful choice for this purpose.

Why Incorrect

A. BLOB: This data type is for storing unstructured binary data, like image or audio files, not for semi-structured data that requires querying of its internal elements.
B. JSON: Snowflake does not have a native JSON data type. It uses the VARIANT type to store, optimize, and query JSON-formatted data.
D. VARCHAR: Storing semi-structured data as a text string in a VARCHAR column prevents the use of Snowflake's optimized functions for querying nested structures.

References

- Snowflake Documentation, "Semi-structured Data Types", Section: VARIANT. This section states, "VARIANT can store values of any other type, including OBJECT and ARRAY. It is the idiomatic type for storing semi-structured data in Snowflake."

- Snowflake Documentation, "Introduction to Semi-structured Data", This page details how Snowflake uses the VARIANT data type to load and operate on semi-structured data such as JSON.

Scroll to Top