COF-C03 - Data Loading, Unloading, and Connectivity - Section 3.3

Unload data from Snowflake with COPY INTO location, choosing file format, compression, and single or multiple output files.

Unload query results to a stage with COPY INTO location: select the output file format and compression, choose between one file and many with the SINGLE and MAX_FILE_SIZE options, and retrieve files from an internal stage with GET. Recognise the default formats and how PARTITION BY can organise unloaded files.

data unloadingCOPY INTO locationSINGLE and MAX_FILE_SIZEGET commandfile compression

Practice question for this objective

Free sampleData Loading, Unloading, and Connectivitymedium

An analyst unloads a query result to an internal stage with COPY INTO and a downstream tool requires the entire output to arrive as one object so it can be ingested in a single read. The result set is small enough to fit comfortably in one file. Which COPY INTO location option should the analyst set to guarantee one output file?

  • ASet SINGLE = TRUE so the unload writes all rows into one output file on the stage instead of the default behaviour of producing several files Correct
  • BSet MAX_FILE_SIZE to a very small byte value so the unload is forced to collapse all of the rows into one compact output file on the stage
  • CSet OVERWRITE = TRUE so any earlier files are replaced and the unload is then reduced to writing a single combined output file on the stage
  • DSet DETAILED_OUTPUT = TRUE so the unload reports each row group and consolidates the parallel threads into one output file on the stage
Recognise that SINGLE = TRUE forces COPY INTO location to write one output file instead of the default multiple files. By default COPY INTO location runs in parallel and writes multiple files, one per data file produced by the execution threads. Setting SINGLE = TRUE overrides this so all unloaded rows go into a single file, which is required when a downstream consumer must read the output as one object. MAX_FILE_SIZE and OVERWRITE control file size and replacement, not the count of files.

Why A is correct: SINGLE = TRUE directs COPY INTO location to write one output file rather than the default set of parallel files, which is exactly what a single-read consumer needs.

Why B is wrong: MAX_FILE_SIZE caps each file's size, so a small value would create more files rather than fewer, which is the opposite of producing a single object.

Why C is wrong: OVERWRITE only controls whether existing files at the path are replaced, so it does not change how many files the unload produces and never forces one file.

Why D is wrong: DETAILED_OUTPUT only expands the result rows the command returns about the operation, so it changes reporting and not the number of files written.

See more COF-C03 practice questions, answers explained.

More in this domain

Back to all Data Loading, Unloading, and Connectivity objectives, or the COF-C03 cert hub.

Examworthy is not affiliated with or endorsed by Snowflake. Original, blueprint-aligned practice material only.