SnowPro Core Recertification — Question 30
Which function can be used with the COPY INTO <location> statement to convert rows from a relational table to a single VARIANT column, and to unload rows into a JSON file?
Answer options
- A. FLATTEN
- B. OBJECT_AS
- C. OBJECT_CONSTRUCT
- D. TO_VARIANT
Correct answer: C
Explanation
The correct answer is C, OBJECT_CONSTRUCT, which is specifically designed to create a JSON object from relational row data, enabling the unloading of rows into a JSON file. The other options do not fulfill this requirement; for instance, FLATTEN is used for expanding nested data, while TO_VARIANT simply converts data types without the JSON formatting context.