Error Handling

By default, any row with fields that cannot be inserted into target columns is discarded silently.

You can override this behavior with the following modifiers to the COPY command:

  • REJECTMAX number - A maximum number of permitted rejected records before a load fails
  • EXCEPTIONS ‘path’ - Local file containing load exceptions, which includes useful error messages for debugging issues
  • REJECTED DATA ‘path’ - Local file where rejected rows are to be stored
  • ABORT ON ERROR - The load is cancelled (that is, no data is loaded) on the first rejected load

Examples:

COPY customers FROM LOCAL 'customers.csv' ABORT ON ERROR;
COPY customers FROM LOCAL 'customers.csv.gz' GZIP WITH PARSER GdcCsvParser
     EXCEPTIONS '/tmp/exceptions.txt' REJECTED DATA '/tmp/rejected.csv'
     REJECTMAX 100