
Answer-first summary for fast verification
Answer: Use the OBJECT_CONSTRUCT function in conjunction with the COPY INTO [location] command.
The correct answer is A because it specifically addresses unloading a relational table to JSON format using OBJECT_CONSTRUCT function with COPY INTO command, which is the documented Snowflake approach for converting relational data to JSON format during unloading. Option B is incorrect because simply setting file_format to JSON with COPY INTO without OBJECT_CONSTRUCT would not properly convert relational table structure to JSON objects. Options C and D are incorrect as PUT and GET commands are for file transfer operations between local systems and Snowflake stages, not for converting relational data to JSON format. The community discussion shows strong consensus for A (78% votes) with multiple references to Snowflake documentation confirming this approach.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can data from a relational table be unloaded into a JSON file?
A
Use the OBJECT_CONSTRUCT function in conjunction with the COPY INTO [location] command.
B
Use the COPY INTO [location] command with the file_format set as JSON.
C
Use the PUT command with the file_format set as JSON.
D
Use the GET command with the file_format set as JSON.
No comments yet.