
Answer-first summary for fast verification
Answer: CREATE OR REPLACE FILE FORMAT my_format TYPE=JSON;
The correct answer is C because Snowflake does not allow changing the file format type using ALTER FILE FORMAT, as confirmed by community testing and documentation. Option A (ALTER FILE FORMAT my_format SET TYPE=JSON) is invalid and results in an error 'File format type cannot be changed.' Option B (ALTER FILE FORMAT my_format SWAP TYPE WITH JSON) uses incorrect syntax and is not supported. Option D (REPLACE FILE FORMAT my_format TYPE=JSON) is invalid as REPLACE is not a valid command for file formats. The only supported method is CREATE OR REPLACE FILE FORMAT, which recreates the file format with the new type while preserving the same name, as verified by community members with upvoted comments and direct testing.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
How do you modify an existing file format named my_format to change its type from CSV to JSON?
A
ALTER FILE FORMAT my_format SET TYPE=JSON;
B
ALTER FILE FORMAT my_format SWAP TYPE WITH JSON;
C
CREATE OR REPLACE FILE FORMAT my_format TYPE=JSON;
D
REPLACE FILE FORMAT my_format TYPE=JSON;