SnowPro Associate: Platform Question 217
Single answer● CommandsA data engineer needs to load new CSV files from an internal named stage into the table SALES_RAW every hour. Before scheduling the production load, the engineer wants to verify which files would be loaded, validate that the column mapping is correct, and avoid inserting any rows during the test. Which command should the engineer run?
- A
COPY INTO SALES_RAW FROM @int_stage/sales FILE_FORMAT = (TYPE = CSV) VALIDATION_MODE = RETURN_ERRORS
- B
COPY INTO SALES_RAW FROM @int_stage/sales FILE_FORMAT = (TYPE = CSV) VALIDATION_MODE = RETURN_ALL_ERRORS
- C
COPY INTO SALES_RAW FROM @int_stage/sales FILE_FORMAT = (TYPE = CSV) VALIDATION_MODE = RETURN_n_ROWS
- D
LIST @int_stage/sales
Show answer and explanation
Correct answer: C
Explanation
The best choice is to use the COPY INTO command with VALIDATION_MODE = RETURN_n_ROWS. This lets the engineer test the load logic against staged files and inspect returned rows without actually inserting data into SALES_RAW. In contrast, RETURN_ERRORS and RETURN_ALL_ERRORS are designed for identifying load errors, not previewing successful parsed rows. LIST is a stage-inspection command only and does not validate load behavior. This aligns with Snowflake documentation for COPY INTO
and its VALIDATION_MODE options, which are commonly used to validate staged data loads before production execution.- A. Incorrect.
Incorrect. VALIDATION_MODE = RETURN_ERRORS validates the COPY operation and returns parsing or conversion errors, but it is intended to report errors rather than preview a sample of rows that would be loaded. It does not help the engineer inspect representative loaded data for column mapping in the same practical way.
- B. Incorrect.
Incorrect. VALIDATION_MODE = RETURN_ALL_ERRORS returns all errors across files for a COPY validation, which is useful for troubleshooting bad data at scale. However, it still focuses on error reporting rather than returning sample rows to confirm that the file structure and column mapping are aligned as expected.
- C. Correct.
Correct. COPY INTO with VALIDATION_MODE = RETURN_n_ROWS performs a dry run and returns parsed rows from the staged files without loading data into the target table. This is the best fit when the engineer wants to verify which data would load and confirm column alignment before scheduling the production COPY command.
- D. Incorrect.
Incorrect. LIST shows the files available in the stage, which can help confirm file presence and names, but it does not validate how Snowflake will parse the CSV data or whether the file columns map correctly to the table. It also does not simulate the COPY load.