How to ignore errors in Redshift COPY?

Recently I had to upload multiple big datasets on Redshift just for test purposes. To do that, I used COPY command which makes data loading very fast. Everything was working great for all datasets excepts one. In fact, it had some not understandable byte marks in one of columns. At that moment I could reprocess the file and either filter out or convert these invalid characters. But fortunately, after a quick research I found an easier way to do that (remember, it was only a test).

Redshift's COPY command provides an argument called MAXERROR. By default, the COPY command fails as soon as it encounters the first invalid row. With MAXERROR specified, you can define how many errors you are willing to accept. 3 was fine for my case and I was able to do my tests on the table without spending time on reconverting the data.

You can learn more about this parameter on the official documentation page.