I am copying data from a Redshift Manifest File stored in S3. My copy command looks like
COPY <table name> FROM 's3://...' CREDENTIALS '<credentials>' FORMAT AS JSON 'auto' GZIP TRUNCATECOLUMNS ACCEPTINVCHARS EMPTYASNULL TIMEFORMAT AS 'auto' REGION '<region>' manifest;
The column in the table where I am facing this issue is of type varchar(255). Value of this column in the s3 file looks like
"<column>":"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000..."
Error: Invalid null byte - field longer than 1 byte
I have tried using NULL AS '\0' as well. That didn't work. The error this gives is Invalid operation: NULL argument is not supported for JSON based COPY