Error in Copy file from s3 to redshift table after unload

Viewed 89

I want to unload a table from redshift cluster 1 and then copy the contents to redshift cluster 2. I am running the following commands :

unload ('select * from table_name') to 's3://bucket/dump_' iam_role 'arn:aws:iam::xxx:role/xxx' delimiter '|' addquotes escape allowoverwrite;

copy cluster2_table from 's3://bucket/dump_' iam_role 'arn:aws:iam::xxx:role/xxx' delimiter '|' removequotes escape;

This is running fine on most of the tables, but getting error in two of them.

The issue is that the second column is being read as the first column. Example : enter image description here enter image description here

I am not sure what is wrong with the file on csv. Its working fine for other tables.

0 Answers
Related