nerdexam
Snowflake

DEA-C02 · Question #141

When working with semi-structured data in a VARIANT column, which Snowflake functions will allow a user to write queries that extract values using a hierarchy name? (Choose two.)

The correct answer is A. GET() C. GET_PATH(). GET() and GET_PATH() are correct because both extract values from VARIANT data using named keys or path hierarchies. GET(variant_col, 'key') retrieves a value by a single field name, while GET_PATH(variant_col, 'a.b.c') navigates a dot-notation path through nested objects…

Data Transformation

Question

When working with semi-structured data in a VARIANT column, which Snowflake functions will allow a user to write queries that extract values using a hierarchy name? (Choose two.)

Options

  • AGET()
  • BPARSE_JSON()
  • CGET_PATH()
  • DLATERAL FLATTEN
  • ETO_ARRAY()

How the community answered

(43 responses)
  • A
    88% (38)
  • B
    5% (2)
  • D
    5% (2)
  • E
    2% (1)

Explanation

GET() and GET_PATH() are correct because both extract values from VARIANT data using named keys or path hierarchies. GET(variant_col, 'key') retrieves a value by a single field name, while GET_PATH(variant_col, 'a.b.c') navigates a dot-notation path through nested objects - both directly address "hierarchy name" extraction.

Why the distractors are wrong:

  • B. PARSE_JSON() converts a JSON string into a VARIANT value - it parses structure, it doesn't extract from it.
  • D. LATERAL FLATTEN explodes arrays/objects into rows - useful for iteration, not direct key-based extraction.
  • E. TO_ARRAY() converts a value into an array type - a type-casting function, not a path extractor.

Memory tip: Think "GET to the value" - both correct answers start with GET, which reminds you they're the getters for VARIANT hierarchy access. If it doesn't start with GET, it's not extracting by name.

Topics

#Semi-structured data#VARIANT data type#JSON functions#Data extraction

Community Discussion

No community discussion yet for this question.

Full DEA-C02 Practice