'Error loading JSON data with special characters from S3 to AWS Redshift - Invalid null byte - field longer than 1 byte

I'm using the redshift COPY command to load large amount of data from S3 into redshift. My data is in JSON format and it contains the special character \u0000 from time to time. I tried the ACCEPTINVCHARS which did not help. The NULL option doesn't work with JSON. Is there a way to make it work, and remove or replace these characters

COPY my_table
FROM 's3://my-bucket/my-location' 
IAM_ROLE 'arn:aws:iam::my-role' 
FORMAT AS JSON 'auto' gzip TRUNCATECOLUMNS  ACCEPTINVCHARS
MAXERROR AS 100
                                                    


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source