Amazon Redshift error while copying json file - Invalid JSONPath format: Member is not an object Amazon Redshift error while copying json file - Invalid JSONPath format: Member is not an object json json

Amazon Redshift error while copying json file - Invalid JSONPath format: Member is not an object


The problem with the COPY command is it does not really accept a valid JSON file. Instead, it expects a JSON-per-line which is shown in the documentation, but not obviously mentioned.

Hence, every line is supposed to be a valid JSON but the full file is not.


Well there are not a lot of JSON capabilities present with Redshift Copy as of now but have you tried using a JSONPaths file?http://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html#r_COPY_command_examples-copy-from-json

If this doesn't work and you can't change the source file format, include another step before the Copy and use some file transformation (if you are using some ETL tool) or Linux functions to remove the square braces from the file.