
Answer-first summary for fast verification
Answer: Convert the rows in a relational table to a single VARIANT column and then unload the rows into a file.
The OBJECT_CONSTRUCT function in Snowflake is used to create JSON objects from key-value pairs. When combined with the COPY INTO command, its purpose is to convert relational table rows into JSON format by creating a single VARIANT column containing the structured data, which can then be unloaded to a file. This is specifically useful for exporting relational data to JSON format. Option B correctly describes this process of converting relational table rows to a VARIANT column and unloading to a file. Option A is incorrect because OBJECT_CONSTRUCT doesn't reorder rows. Option C is incorrect as it describes loading data into a table, not unloading. Option D is incorrect because it describes loading from a file to a variant table, which is the opposite direction of what OBJECT_CONSTRUCT with COPY INTO is used for.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
What is the purpose of using the OBJECT_CONSTRUCT function in conjunction with the COPY INTO command?
A
Reorder the rows in a relational table and then unload the rows into a file.
B
Convert the rows in a relational table to a single VARIANT column and then unload the rows into a file.
C
Reorder the data columns according to a target table definition and then unload the rows into the table.
D
Convert the rows in a source file to a single VARIANT column and then load the rows from the file to a variant table.
No comments yet.