1. A data engineer needs to query a VARIANT column named EVENT_DATA that stores JSON objects like the following: {"user": {"id": 1042, "region": "us-west"}, "action": "login"} Which two of the following expressions correctly retrieve the value of the "region" field? (Select TWO.)
- A. EVENT_DATA['user']['region']✓ Correct
- B. EVENT_DATA:user:region✓ Correct
- C. EVENT_DATA->user->region
- D. GET(EVENT_DATA, 'user.region')
- E. EVENT_DATA.user.region
Explanation
Snowflake supports two notations for traversing VARIANT JSON: bracket notation (EVENT_DATA['user']['region']) and colon notation (EVENT_DATA:user:region). Both are valid and return the same result. The arrow operator (->) is not valid Snowflake SQL syntax for VARIANT traversal. GET(col, 'user.region') attempts a single-level key lookup for the literal string 'user.region', which would return NULL because the key is not at the top level. Dot notation (EVENT_DATA.user.region) is only valid in Snowpark DataFrame APIs, not in SQL queries.