RedShift - CSV load with line Break

半城伤御伤魂 提交于 2019-12-24 01:13:39

问题


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

Delimited value missing end quote

CSV file Error line

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

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/45687458/redshift-csv-load-with-line-break

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!