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…
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)- A86% (31)
- B8% (3)
- C3% (1)
- D3% (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
Community Discussion
No community discussion yet for this question.