I am trying to perform a load / copy operation to import data from JSON files into an S3 bucket directly in Redshift. COPY operation succeeds, and after COPY the table has the correct number of rows / records, but each record is NULL!
It takes the expected amount of time to load, the COPY command returns OK, the Redshift console reports successful results and no errors ... but if I execute a simple query from a table, it returns only NULL values.
JSON is very simple + flat and formatted correctly (according to the examples I found here: http://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html )
Basically, this is one line per line, formatted as:
{ "col1": "val1", "col2": "val2", ... } { "col1": "val1", "col2": "val2", ... } { "col1": "val1", "col2": "val2", ... }
I tried things like rewriting a schema based on values ββand data types found in JSON objects, as well as copying from uncompressed files. I thought that maybe JSON understood correctly on loading, but it should probably cause an error if the objects cannot be parsed.
My COPY command looks like this:
copy events from 's3://mybucket/json/prefix' with credentials 'aws_access_key_id=xxx;aws_secret_access_key=xxx' json 'auto' gzip;
Any guidance would be appreciated! Thanks.
amazon-web-services amazon-redshift
shane
source share