Study FAQ
How do I choose single-file, parallel, or partitioned output for a Snowflake export?
Also asked as 2
- What controls the number, size, and layout of Snowflake unload files?
- When should I use SINGLE, MAX_FILE_SIZE, or PARTITION BY in a Snowflake unload?
Answer
Keep the default parallel output for consumers that can process multiple files. Set SINGLE = TRUE when the receiver requires one file and you accept the potential throughput cost. Use PARTITION BY when directory-level pruning helps a downstream consumer and the partition values are safe to expose.
With parallel output, Snowflake adds a generated suffix to filenames. A path prefix is a naming hint, so capture the generated names rather than guessing them. MAX_FILE_SIZE influences file sizes and does not guarantee a specific count or strict byte cap. Leave headroom below any hard downstream or storage limit. With SINGLE = TRUE, give the destination an explicit filename and extension that matches the actual compression. For example, use a .csv.gz name when specifying GZIP compression.
PARTITION BY uses a string-valued expression and places its values in object paths. These paths can also appear in Snowflake support logs. Use a non-sensitive bucket such as a delivery date. Partitioned unloads require query IDs in the filenames and cannot use SINGLE = TRUE or OVERWRITE = TRUE. Verify layout and file sizes from the command's output or stage listing using a representative data set.
Unload options and partition handling · Data unloading considerations
Full explanation
Unloading Data and Building Reliable Export Workflows
Study guide · COF-C03
Read the full explanation