Redshift Copy fails due to '\' present in some of the data in my csv file

0

I am trying to copy csv file from S3 to Redshift table. I have few of the columns present in my csv file that contains '' in the data. Below is the sample data:

columnA|columnB|columnC|columnD|columnE

abc|12|xyz|test|hello

lmn|123|pqr|test|bye

jkl|124|deg|test|hi

I am using below command to copy in Redhisft, but it fails:

COPY redshif_schema.redshift_table_name from 's3://bucket/folder/inputfile.csv' access_key_id '<access_id>' secret_access_key '<secret_key>' fillrecord escape delimiter as '|' IGNOREHEADER as 1 ACCEPTANYDATE emptyasnull blanksasnull maxerror 0 ;

When I check raw_line in stl_load_errors table, I see below (2 back slashes):

abc|12|xyz|test|hello

Can someone please help with this?

feita há 3 anos2097 visualizações
1 Resposta
0

Redshift is interpreting the backslash as an escape since you have specified ESCAPE in your COPY.

You can try:

respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas