Study FAQ
How do I validate Snowflake bulk COPY input and reconcile rejected rows?
Also asked as 2
- How can I check parsing errors before a bulk COPY and confirm accepted and rejected rows afterward?
- How do I combine Snowflake COPY validation and load results to find rejected data?
Answer
For a compatible, non-transforming bulk COPY INTO <table>, validate representative staged files with the production file format and target types using VALIDATION_MODE = RETURN_ERRORS. Choose an explicit error policy, then reconcile the real COPY result, its load history, and the target rows against the source manifest and your rejected-row threshold.
- Compare staged names, field order or mapping, delimiters, quoting, null markers, and target types. A malformed field can look like a conversion error once fields shift.
- For an ordinary bulk load,
ABORT_STATEMENTis the default.CONTINUEcan load valid rows while rejecting invalid ones, andSKIP_FILEskips affected files. Agree on what constitutes an acceptable partial load before using a tolerant policy. VALIDATION_MODEhas restrictions, including transformed loads,MATCH_BY_COLUMN_NAME, and Iceberg tables. It also does not test target CHECK constraints. For a transformed or otherwise unsupported load, test the actual mapping in an isolated representative target.VALIDATEcan report errors after eligible bulk loads, subject to its own restrictions.- Capture per-file status, rows parsed, rows loaded, and available error detail. Use the Information Schema
COPY_HISTORYtable function for recent completed load activity in its 14-day window. The Account Usage view covers up to 365 days and can lag. Preserve the command result and query ID, especially for an abort or failure. Restrict access to diagnostics containing sensitive rejected values.
Confirm accepted totals and downstream freshness before archiving or deleting inputs. A successful statement with tolerated errors can still be an incomplete delivery.
Validation and error handling · VALIDATE · Information Schema COPY_HISTORY · Account Usage COPY_HISTORY · Error logging
Full explanation
Loading Data with Stages, File Formats, COPY INTO, and Snowpipe
Study guide · COF-C03
Read the full explanation