RedShift - CSV load with line Break

2019-07-18 16:07发布

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

2条回答
成全新的幸福
2楼-- · 2019-07-18 16:21

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.

查看更多
聊天终结者
3楼-- · 2019-07-18 16:33

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

查看更多
登录 后发表回答