
Answer-first summary for fast verification
Answer: FLATTEN
The FLATTEN function is specifically designed to produce a lateral view of VARIANT, OBJECT, or ARRAY columns in Snowflake. As confirmed by the community discussion with 100% consensus and supporting documentation references, FLATTEN explodes semi-structured data into a relational format that can be joined laterally with the original table. GET_PATH and GET are used for extracting specific elements from VARIANT data but do not produce lateral views. PARSE_JSON is for converting JSON strings to VARIANT type, not for creating lateral views.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.