nerdexam
Snowflake

COF-C02 · Question #594

Which function can be used to convert semi-structured data into rows and columns?

The correct answer is B. FLATTEN. FLATTEN is a Snowflake table function that explodes semi-structured data (arrays or objects stored in VARIANT columns) into individual rows and columns. For example, a VARIANT array of 5 elements becomes 5 rows with each element accessible as a column. PARSE_JSON (C) parses a…

Data Transformations

Question

Which function can be used to convert semi-structured data into rows and columns?

Options

  • ATABLE
  • BFLATTEN
  • CPARSE_JSON
  • DJSON EXTRACT PATH TEXT

How the community answered

(38 responses)
  • B
    95% (36)
  • C
    3% (1)
  • D
    3% (1)

Explanation

FLATTEN is a Snowflake table function that explodes semi-structured data (arrays or objects stored in VARIANT columns) into individual rows and columns. For example, a VARIANT array of 5 elements becomes 5 rows with each element accessible as a column. PARSE_JSON (C) parses a JSON string into a VARIANT but does not expand it into rows. JSON_EXTRACT_PATH_TEXT (D) extracts a scalar value from JSON. TABLE (A) is a keyword used to invoke table functions, not a transformation function itself.

Topics

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

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice