Challenge - 5 Problems
Semi-structured Data Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
Extracting nested JSON values in Snowflake
Given a Snowflake table events with a VARIANT column
data storing JSON objects, what is the output of this query?SELECT data:user:name AS user_name FROM events WHERE data:user:age > 30;
Attempts:
2 left
💡 Hint
Remember that Snowflake uses colon notation to access nested JSON keys inside VARIANT columns.
✗ Incorrect
The query extracts the 'name' field from the nested 'user' object in the JSON stored in 'data'. The WHERE clause filters rows where the 'age' field inside 'user' is greater than 30. This returns user names matching the condition.
❓ Configuration
intermediate2:00remaining
Loading Avro data into Snowflake
Which Snowflake COPY INTO command correctly loads Avro files from an S3 bucket into a table named
avro_table with a VARIANT column data?Attempts:
2 left
💡 Hint
Avro files require specifying FILE_FORMAT type as 'AVRO' in Snowflake.
✗ Incorrect
Option A correctly specifies the FILE_FORMAT as AVRO and loads data into the VARIANT column 'data'. Other options specify wrong file formats.
❓ Architecture
advanced2:00remaining
Optimizing queries on semi-structured data in Snowflake
You have a large Snowflake table with a VARIANT column storing JSON data. Which approach best improves query performance when filtering on nested JSON fields?
Attempts:
2 left
💡 Hint
Materialized views can precompute and store extracted data for faster access.
✗ Incorrect
Materialized views that extract nested JSON fields into separate columns allow Snowflake to optimize queries better than scanning VARIANT columns directly.
❓ security
advanced2:00remaining
Securing access to semi-structured data in Snowflake
Which Snowflake feature allows restricting access to specific keys inside a VARIANT column storing JSON data?
Attempts:
2 left
💡 Hint
Masking policies can dynamically hide parts of data based on conditions.
✗ Incorrect
Masking policies can be defined to mask or reveal specific keys inside VARIANT columns, controlling access at a fine-grained level.
🧠 Conceptual
expert2:00remaining
Understanding Snowflake's handling of nested JSON arrays
Given a VARIANT column
data containing JSON arrays of objects, which Snowflake SQL function correctly flattens the array for querying individual elements?Attempts:
2 left
💡 Hint
Snowflake uses a specific function to flatten VARIANT arrays in lateral joins.
✗ Incorrect
Snowflake's LATERAL FLATTEN function is designed to expand arrays inside VARIANT columns into rows for querying.