
Answer-first summary for fast verification
Answer: OBJECT_CONSTRUCT
The question asks which function converts rows from a relational table into a single VARIANT column. OBJECT_CONSTRUCT (D) is the correct answer because it creates a JSON object (stored as VARIANT) from key-value pairs, which is commonly used to transform relational row data into semi-structured format. ARRAY_AGG (A) aggregates values into an array, not specifically into a VARIANT column. OBJECT_AGG (B) aggregates key-value pairs across rows but is for aggregation, not row-to-VARIANT conversion. ARRAY_CONSTRUCT (C) builds an array from expressions but does not inherently convert relational rows to VARIANT. The community discussion supports D with a reference to Snowflake documentation, and it has upvotes, confirming consensus.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.