Which function is used to unload a relational table into a JSON file*?
A.
PARSE_JSON
B.
JSON_EXTRACT_PATH_TEXT
C.
OBJECT_CONSTRUCT
D.
TO_JSON
The Answer Is:
D
This question includes an explanation.
Explanation:
TheTO_JSONfunction in Snowflake is used to convert a relational table or individual rows into JSON format. This function is helpful for exporting data in JSON format.
Using TO_JSON Function:
SELECT TO_JSON(OBJECT_CONSTRUCT(*))
FROM my_table;
Exporting Data:TheTO_JSONfunction converts the table rows into JSON format, which can then be exported to a file.