COF-C02 · Question #456
COF-C02 Question #456: Real Exam Question with Answer & Explanation
The correct answer is D: OBJECT_CONSTRUCT. The OBJECT_CONSTRUCT function in Snowflake is used to convert rows in a relational table into a single VARIANT column that represents each row as a JSON object. This function dynamically creates a JSON object from a list of key-value pairs, where each key is a column name and eac
Question
Which function is used to convert rows in a relational table to a single VARIANT column?
Options
- AARRAY_AGG
- BOBJECT_AGG
- CARRAY_CONSTRUCT
- DOBJECT_CONSTRUCT
Explanation
The OBJECT_CONSTRUCT function in Snowflake is used to convert rows in a relational table into a single VARIANT column that represents each row as a JSON object. This function dynamically creates a JSON object from a list of key-value pairs, where each key is a column name and each value is the corresponding column value for a row. This is particularly useful for aggregating and transforming structured data into semi-structured JSON format for further processing or analysis.
Topics
Community Discussion
No community discussion yet for this question.