SnowPro Associate: Platform Question 218
Single answer● CommandsA data engineer loaded several CSV files from an internal stage into a Snowflake table using COPY INTO. After the load, the engineer notices that some rows were rejected because one of the numeric columns contained invalid text values. The engineer wants to identify exactly which rows failed and why, without re-running the entire load. Which command should be used?
- A
SELECT * FROM TABLE(VALIDATE(my_table, JOB_ID => '_last'));
- B
SHOW ERRORS IN TABLE my_table;
- C
DESCRIBE HISTORY my_table;
- D
LIST @my_internal_stage;
Show answer and explanation
Correct answer: A
Explanation
When a COPY INTO command partially loads data and rejects some rows, Snowflake provides the VALIDATE table function to inspect load errors from a prior load job. This is especially useful for troubleshooting data quality issues such as invalid numeric values, malformed dates, or column parsing problems. The JOB_ID parameter can reference a specific load job, and '_last' is commonly used to review the most recent COPY operation on that table. In contrast, LIST only shows staged files, and metadata/history-oriented commands or views do not replace VALIDATE for row-level error analysis. This aligns with Snowflake documentation on data loading, COPY INTO behavior, and the VALIDATE function for troubleshooting load errors.
- A. Correct.
Correct. The VALIDATE table function is used to return error details for rows that failed during a previous COPY INTO operation. Using JOB_ID => '_last' is a common way to inspect the most recent load for that table. This is the appropriate command when the goal is to review rejected rows and the specific load errors without re-running the load.
- B. Incorrect.
Incorrect. Snowflake does not provide a generic SHOW ERRORS IN TABLE command for reviewing row-level COPY load failures. A candidate might choose this because SHOW commands are commonly used for metadata inspection, but row-level data load validation is handled through the VALIDATE function.
- C. Incorrect.
Incorrect. DESCRIBE HISTORY is not the command used to inspect rejected rows from a COPY INTO operation. Snowflake provides load history through views/functions such as COPY_HISTORY and account usage views, but those are for load event metadata rather than detailed rejected-row validation. This option reflects confusion between operational history and row-level error diagnostics.
- D. Incorrect.
Incorrect. LIST displays files in a stage and is useful for verifying staged file presence and names, but it does not provide information about which rows failed during a COPY INTO load or why they failed.