What is the recommended way to change the existing file format type in my_format from CSV to JSON?
What is the recommended way to change the existing file format type in my_format from CSV to JSON?
To change the existing file format type in my_format from CSV to JSON, the recommended way is to recreate the file format. Therefore, you should use the command: CREATE OR REPLACE FILE FORMAT my_format TYPE=JSON. This command will replace the existing file format with the new JSON type.
ALTER FILE FORMAT does not support the following actions: - Changing the type (CSV, JSON, etc.) for the file format. To make any of these changes, you must recreate the file format.
C A doesn't work, I tested: --- 803 CREATE FILE FORMAT ET_803 TYPE=CSV; DESCRIBE FILE FORMAT ET_803; ALTER FILE FORMAT ET_803 SET TYPE =JSON; ---File format type cannot be changed. CREATE OR REPLACE FILE FORMAT ET_803 TYPE=JSON; DESCRIBE FILE FORMAT ET_803; DROP FILE FORMAT ET_803;
C correct - https://docs.snowflake.com/en/sql-reference/sql/create-file-format
Answer C is correct