TheDataGuy
TheDataGuy

Reputation: 3108

RedShift - CSV load with line Break

Im trying to load a CSV file while loading I got the error

Delimited value missing end quote

CSV file Error line

enter image description here

REDSHIFT ERROR:

line_number     | 13
colname         | Comment
col_length      | 250
raw_line        |"123"|"123"|"xyz"|"2009-06-25 21:00:14.660000000"|"0"|""|""|""|""|""|"HI,

raw_field_value | HI, 
err_code        | 1214
err_reason      | Delimited value missing end quote

Upvotes: 4

Views: 8826

Answers (2)

Jon Ekiz
Jon Ekiz

Reputation: 1022

You could use CSV option in COPY command. Don't use REMOVEQUOTES or ESCAPE with it. CSV handles everything so in my opinion it's the best solution.

http://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-format.html#copy-csv

Upvotes: 5

Joe Harris
Joe Harris

Reputation: 14035

You'll need to escape the newline characters in the source data and then specify the ESCAPE option in your COPY statement. Please have a look at "Preparing Files for COPY with the ESCAPE Option" for more details.

Upvotes: 1

Related Questions