I have a nested json as my source file in S3 and I am trying to copy this file into redshift. My issues with this are as follows,
- I use MAXERROR - I need to skip certain errors because the source file is missing certain fields in some cases and has them in other
- I use a JSONPATH file - to pick the fields that I need to copy to redshift
- All the columns in the table are varchar
Obviously, since I am using maxerror the copy command executes successfully but the table has 0 records. Here is my copy command
COPY public.table(col1,col2,col3,col4,col5,col6)
from 's3://bucket/filename'
credentials 'redshift'
format as JSON 'jsonpathfile.json'
timeformat 'YYYY-MM-DDTHH:MI:SS'
EMPTYASNULL ACCEPTANYDATE ACCEPTINVCHARS TRUNCATECOLUMNS maxerror 100 ;
If I check into stl_load_errors it keeps saying
Invalid JSONPath format: Member is not an object.
Does this mean the copy command is not able to find even one object that fits the jsonpath file? Which is definitely not true. I inferred the schema of the input file to design the jsonpath file.