I’m attempting 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. Why, and 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 will not load properly. Replace the carriage returns with CRLF (“\r\n” or “0x0D0A” in hex) or LF (“\n” or “0x0A” in hex), and attempt the COPY command again.

Because carriage returns (commonly used by many Windows programs) are not recognized by 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, 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 attempt to load the file using the COPY command again.

Amazon Redshift, copy, empty, Amazon S3


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