If you override file format options in a COPY INTO statement to CSV while a stage is configured for JSON, which format is used for the load?

Master Snowflake Data Engineer Exam. Study with flashcards and multiple choice questions, each question includes hints and explanations. Prepare for your success!

Multiple Choice

If you override file format options in a COPY INTO statement to CSV while a stage is configured for JSON, which format is used for the load?

Explanation:
The load uses the CSV format. In Snowflake, a stage can have a default file format, but any FILE_FORMAT you specify directly in the COPY INTO statement overrides that default for that operation. So even though the stage is configured for JSON, overriding the format to CSV in the COPY INTO makes the data be parsed as CSV for that load. If you omit the override, or specify JSON again in the COPY, then JSON would be used.

The load uses the CSV format. In Snowflake, a stage can have a default file format, but any FILE_FORMAT you specify directly in the COPY INTO statement overrides that default for that operation. So even though the stage is configured for JSON, overriding the format to CSV in the COPY INTO makes the data be parsed as CSV for that load. If you omit the override, or specify JSON again in the COPY, then JSON would be used.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy