正解:B
The correct answer is B. PARTITION BY .
The PARTITION BY option in COPY INTO < location > partitions unloaded data into separate files based on the expression specified. This is commonly used to organize unloaded files by values such as date, region, or another column.
Why B is correct:
PARTITION BY controls how unloaded rows are grouped into different output paths/files.
Example:
COPY INTO @my_stage/sales/
FROM sales
PARTITION BY (TO_DATE(sale_date))
FILE_FORMAT = (TYPE = CSV);
This unloads rows into separate output paths based on the sale_date expression.
Why the other options are incorrect:
A). DETAILED_OUTPUT controls the amount of unload result information returned by the command.
C). FILE_FORMAT controls the format of the unloaded files, such as CSV, JSON, or Parquet.
D). HEADER controls whether column headings are included in unloaded output files.
Official Snowflake documentation reference:
Snowflake documentation for COPY INTO < location > describes PARTITION BY as the option used to partition unloaded rows into separate files based on an expression.
Reference: Snowflake Documentation - COPY INTO < location > ; Snowflake Documentation - Unloading data with partitioning; SnowPro Core Study Guide - Data Loading and Unloading.