COF-C02 practice question 8 of 35
When unloading to a stage, which of the following is a recommended practice or approach?
Full set: 778 questionsDefining a named file format is a recommended practice when unloading data. A named file format is a reusable, schema-level object that encapsulates all the necessary format-specific information (e.g., TYPE, COMPRESSION, FIELDDELIMITER). Using a named file format promotes consistency across multiple unload operations, simplifies the COPY INTO command by referencing the object instead of listing options inline, and improves overall manageability and governance of data pipelines. This approach decouples the file format definition from the data movement logic, making the process more modular and easier to maintain.
A. Set SINGLE = true for larger files This is incorrect. Setting SINGLE = true forces the unload operation into a single thread, which severely degrades performance, especially for larger files. The recommended practice for large datasets is to unload in parallel to multiple files.
B. Use OBJECTCONSTRUCT ( ) when using Parquet This is incorrect. Parquet is a columnar format. Using OBJECTCONSTRUCT() would combine all columns into a single VARIANT object, negating the benefits of Parquet's columnar structure and query performance.
C. Avoid the use of the CAST function This is incorrect. The CAST function and other transformation functions are frequently necessary during unloading to format data, convert data types, or restructure the output to meet the requirements of the target system. ---
1. Correct Answer (D): Snowflake Documentation
"Preparing to Unload Data". This section outlines the prerequisite steps for unloading
which includes creating named file formats. It states
"Create a named file format that describes the format of your data files... You can also specify file format options in the COPY INTO command." Creating the object beforehand is presented as a standard
reusable approach.
Source: Snowflake Documentation > Data Loading & Unloading > Unloading Data > Preparing to Unload Data.
2. Incorrect Option (A): Snowflake Documentation
"COPY INTO ". The description for the SINGLE copy option explicitly warns against its use for large data sets. It states
"Note that the unload operation will be slower [with SINGLE = TRUE]. For the best performance
unload to multiple files."
Source: Snowflake Documentation > SQL Reference > DML Commands > COPY INTO > Optional Parameters > SINGLE = TRUE | FALSE.
3. Incorrect Option (B): Snowflake Documentation
"Unloading data into a Parquet file". The examples show selecting individual columns to be mapped to columns in the Parquet file
preserving the columnar structure. There is no recommendation to use OBJECTCONSTRUCT()
which would be counter-intuitive for this format.
Source: Snowflake Documentation > Data Loading & Unloading > Unloading Data > Unloading data into a Parquet file.
4. Incorrect Option (C): Snowflake Documentation
"Data Unloading Considerations". This page discusses transforming data during an unload. It provides examples of using functions within the SELECT statement of the COPY command to format the data
which often involves CAST or similar functions (e.g.
TOCHAR
TOVARCHAR).
Source: Snowflake Documentation > Data Loading & Unloading > Unloading Data > Data Unloading Considerations > Transforming Data During an Unload.
Keep practicing
Take the free COF-C02 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other COF-C02 practice questions
- Question 1What does Snowflake recommend regarding database object ownership? (Select TWO).
- Question 2What kind of value does a User-Defined Function (UDF) return? (Select TWO).
- Question 3How do Snowflake data providers share data that resides in different databases?
- Question 4What are supported file formats for unloading data from Snowflake? (Choose three.)
- Question 5A marketing co-worker has requested the ability to change a warehouse size on their mediu…
- Question 6What service is provided as an integrated Snowflake feature to enhance Multi-Factor Authe…
