D. TO_JSON
Explanation:
TO_JSON is used to convert relational data into JSON format, which is ideal when unloading a relational table into a JSON file.
Why the others are wrong:
A. PARSE_JSON: This function is used to parse a JSON string into a Snowflake-compatible format, not for converting relational data into JSON.
B. JSON_EXTRACT_PATH_TEXT: This function extracts specific values from JSON data, but it doesn't convert relational data into JSON.
C. OBJECT_CONSTRUCT: This creates a JSON object from key-value pairs, but it doesn't convert the entire relational data into JSON format.
Example of using TO_JSON:
SELECT TO_JSON(OBJECT_CONSTRUCT(*)) FROM my_table;
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
md_2000
1 month ago