nerdexam
Snowflake

COF-C02 · Question #310

What function can be used with the recursive argument to return a list of distinct key names in all nested elements in an object?

The correct answer is A. FLATTEN. The FLATTEN table function in Snowflake supports a RECURSIVE argument (RECURSIVE => TRUE). When used with MODE => 'OBJECT' and RECURSIVE => TRUE, it traverses all nested levels of a semi-structured object and returns rows that include key names at every depth level. This makes…

Data Transformations

Question

What function can be used with the recursive argument to return a list of distinct key names in all nested elements in an object?

Options

  • AFLATTEN
  • BGET_PATH
  • CCHECK_JSON
  • DPARSE JSON

How the community answered

(36 responses)
  • A
    86% (31)
  • B
    8% (3)
  • C
    3% (1)
  • D
    3% (1)

Explanation

The FLATTEN table function in Snowflake supports a RECURSIVE argument (RECURSIVE => TRUE). When used with MODE => 'OBJECT' and RECURSIVE => TRUE, it traverses all nested levels of a semi-structured object and returns rows that include key names at every depth level. This makes it possible to discover distinct key names across all nested elements. GET_PATH retrieves a value at a specific path. CHECK_JSON and PARSE_JSON do not have recursive traversal capabilities for key enumeration.

Topics

#FLATTEN function#Semi-structured data#JSON traversal#Data transformation

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice