0
0
Snowflakecloud~5 mins

Semi-structured data querying (JSON, Avro) in Snowflake - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is semi-structured data?
Semi-structured data is data that does not follow a strict table format but has some organizational properties like tags or keys, for example, JSON or Avro files.
Click to reveal answer
beginner
How does Snowflake store JSON data?
Snowflake stores JSON data in a VARIANT column type, which allows flexible storage and querying of nested JSON structures.
Click to reveal answer
intermediate
Which Snowflake function extracts a value from a JSON object?
The function is called GET_PATH or the simpler : operator, for example, data:field extracts the value of 'field' from the JSON stored in 'data'.
Click to reveal answer
intermediate
What is Avro and why is it used?
Avro is a compact, fast, binary data serialization format often used for big data. It supports schema evolution and is efficient for storage and transport.
Click to reveal answer
intermediate
How do you query nested JSON arrays in Snowflake?
You use the LATERAL FLATTEN function to expand arrays into rows, allowing you to query each element individually.
Click to reveal answer
Which Snowflake data type is best for storing JSON data?
AVARIANT
BVARCHAR
CINTEGER
DBOOLEAN
What does the Snowflake function LATERAL FLATTEN do?
AConverts JSON arrays into multiple rows
BCompresses JSON data
CEncrypts data
DJoins two tables
Avro files are primarily used because they are:
APlain text and human-readable
BBinary and support schema evolution
COnly for images
DUnstructured data format
How do you extract a nested field 'name' from a JSON column 'data' in Snowflake?
Adata.name
Bdata->name
Cdata:name
Ddata[name]
Which of the following is NOT a characteristic of semi-structured data?
AOften stored as JSON or Avro
BFlexible schema
CContains nested structures
DFixed schema with strict columns
Explain how Snowflake handles querying JSON data stored in a VARIANT column.
Think about how you would get data from a nested folder in your computer.
You got /4 concepts.
    Describe the advantages of using Avro format for big data storage and querying.
    Consider why a small, flexible box is better for shipping many items.
    You got /4 concepts.