I’m trying to load a CSV file from Amazon S3 into Amazon Redshift using the COPY command, but nothing is loaded (even though the file contains records), and no errors are returned. How do I resolve this?

If the CSV file uses carriage returns (“\\r”, “^M”, or “0x0D” in Hex) as a line terminator, the lines in your CSV file won't load properly. Replace the carriage returns with CRLF (“\\r\\n” or “0x0D0A” in hex) or LF (“\\n” or “0x0A” in hex), and try the COPY command again.

Because carriage returns (commonly used by many Windows programs) aren't recognized by Amazon Redshift as a line terminator, the file is parsed as one line.

If the COPY command has the IGNOREHEADER parameter set to a non-zero number, Amazon Redshift skips the first line, and therefore, the entire file. No load errors are returned, because the operation was technically successful.

To resolve this error, edit the CSV file to use a line terminator other than a carriage return, upload the file to your S3 bucket, and then load the file using the COPY command again.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-09-28

Updated: 2018-07-09