
Answer-first summary for fast verification
Answer: To split the output into multiple files, one for each distinct value of the specified expression.
The PARTITION BY clause in the COPY INTO <location> command is used to split the output data into multiple files based on distinct values of the specified expression. This is confirmed by the Snowflake documentation links provided in the community discussion, which show that PARTITION BY creates separate files for each partition value, improving performance and organization when unloading large datasets. Option A is incorrect because sorting is handled by the ORDER BY clause, not PARTITION BY. Option B is incorrect because delimiting records is controlled by the FIELD_DELIMITER parameter. Option C is incorrect because window functions and adding new columns are not related to the PARTITION BY clause in data unloading operations.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When unloading data using the COPY INTO <location> command, what is the purpose of the PARTITION BY clause?
A
To sort the contents of the output file by the specified expression.
B
To delimit the records in the output file using the specified expression.
C
To include a new column in the output using the specified window function expression.
D
To split the output into multiple files, one for each distinct value of the specified expression.
No comments yet.