COF-C02 · Question #322
Which Snowflake command can be used to unload the result of a query to a single file?
The correct answer is C. Use COPY INTO <internal stage> with SINGLE = TRUE followed by a GET command to download. By default, COPY INTO distributes output across multiple files for parallelism. To force output into a single file, you add SINGLE = TRUE to the COPY INTO command. When targeting an internal stage (Snowflake-managed storage), you then use the GET command to download the file…
Question
Which Snowflake command can be used to unload the result of a query to a single file?
Options
- AUse COPY INTO <external stage> followed by a GET command to download the file.
- BUse COPY INTO <internal stage> followed by a put command to download the file.
- CUse COPY INTO <internal stage> with SINGLE = TRUE followed by a GET command to download
- DUse COPY INTO <external stage> with SINGLE = TRUE followed by a PUT command to
How the community answered
(20 responses)- A5% (1)
- C90% (18)
- D5% (1)
Explanation
By default, COPY INTO distributes output across multiple files for parallelism. To force output into a single file, you add SINGLE = TRUE to the COPY INTO command. When targeting an internal stage (Snowflake-managed storage), you then use the GET command to download the file from the stage to your local machine. The key distinction here is directional: PUT uploads local files to an internal stage; GET downloads from an internal stage. External stages (S3, Azure Blob, GCS) use your cloud provider's tools for download - not GET or PUT. So option C correctly combines SINGLE = TRUE with an internal stage and GET.
Topics
Community Discussion
No community discussion yet for this question.