
Answer-first summary for fast verification
Answer: OBJECT_CONSTRUCT
The question asks which function converts relational table rows to a single VARIANT column for unloading into a JSON file using COPY INTO. OBJECT_CONSTRUCT is specifically designed to build JSON objects from key-value pairs, making it ideal for transforming relational data into JSON format stored in a VARIANT column. The community discussion shows 100% consensus on C (OBJECT_CONSTRUCT), with multiple comments confirming its purpose for converting rows to JSON objects in VARIANT columns. FLATTEN (A) is used to explode semi-structured data, not construct it. OBJECT_AS (B) is not a valid Snowflake function. TO_VARIANT (D) converts scalar values to VARIANT but doesn't construct JSON objects from rows.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.