An administrator needs to troubleshoot a failing COPY INTO command. They want to see exactly which rows are failing and the specific error messages without actually loading any valid data into the table. Which parameter should they use?
Trap 1: VALIDATION_MODE = RETURN_ALL_ERRORS
While 'RETURN_ERRORS' is a valid setting, 'RETURN_ALL_ERRORS' is not a recognized keyword for the VALIDATION_MODE parameter. Snowflake syntax is strict, and using the wrong keyword will result in a syntax error. The correct option identifies the errors encountered in the files being processed during the validation phase.
Trap 2: ON_ERROR = RETURN_ERRORS
The ON_ERROR parameter and VALIDATION_MODE parameter serve different purposes. ON_ERROR defines how the system handles errors during an active load, while VALIDATION_MODE is specifically for testing the load without inserting data. Combining the two incorrectly will lead to a command failure as 'RETURN_ERRORS' is not a valid value for ON_ERROR.
Trap 3: VALIDATION_MODE = RETURN_1_ROWS
The VALIDATION_MODE parameter does support returning a specific number of rows (e.g., RETURN_n_ROWS), but this is used to verify that the data mapping is correct for the first few records. It does not provide a comprehensive list of all errors in the file set, making it less effective for troubleshooting a large, failing batch.
- A
VALIDATION_MODE = RETURN_ALL_ERRORS
Why it fails: While 'RETURN_ERRORS' is a valid setting, 'RETURN_ALL_ERRORS' is not a recognized keyword for the VALIDATION_MODE parameter. Snowflake syntax is strict, and using the wrong keyword will result in a syntax error. The correct option identifies the errors encountered in the files being processed during the validation phase.
- B
ON_ERROR = RETURN_ERRORS
Why it fails: The ON_ERROR parameter and VALIDATION_MODE parameter serve different purposes. ON_ERROR defines how the system handles errors during an active load, while VALIDATION_MODE is specifically for testing the load without inserting data. Combining the two incorrectly will lead to a command failure as 'RETURN_ERRORS' is not a valid value for ON_ERROR.
- C
VALIDATION_MODE = RETURN_ERRORS
Setting VALIDATION_MODE to RETURN_ERRORS is the standard way to debug ingestion issues. It instructs Snowflake to scan the source files and return a result set containing the error reason, the column name, and the raw line content for every error found. No data is actually written to the target table during this process.
- D
VALIDATION_MODE = RETURN_1_ROWS
Why it fails: The VALIDATION_MODE parameter does support returning a specific number of rows (e.g., RETURN_n_ROWS), but this is used to verify that the data mapping is correct for the first few records. It does not provide a comprehensive list of all errors in the file set, making it less effective for troubleshooting a large, failing batch.