
Answer-first summary for fast verification
Answer: FLATTEN
The FLATTEN function in Snowflake is specifically designed to convert semi-structured data (like JSON, XML, or arrays) into a relational tabular format by 'exploding' nested structures into multiple rows and columns. This directly addresses the question's requirement. PARSE_JSON converts string data to JSON objects but doesn't create relational representation. OBJECT_CONSTRUCT builds JSON objects from key-value pairs. OBJECT_AGG aggregates key-value pairs into a single object. Neither of these functions transforms semi-structured data into relational format like FLATTEN does. The community discussion with 100% consensus on option B and references to Snowflake documentation confirms this is the correct answer.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.