COPY tmp_data FROM 's3://mybucket/copy/batch_insert_data_1417072335118.json' credentials 'aws_access_key_id=XXXXXXXXXXXXXXX;aws_secret_access_key=YyYYYyyYYYYYyyYYYYyyYYYYY' json gzip ACCEPTINVCHARS ' ' TRUNCATECOLUMNS TRIMBLANKS;
Above COPY command works without gzip. But Now i want to use the gzip to speed up the process. Now im uploading a gzipped json file into S3 bucket. But the above copy command does not work? any idea how to load a gzipped json file from COPY in Redshift?
You are missing json_option (http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html). Try setting it 'auto'. See corrected example below:
COPY tmp_data FROM 's3://mybucket/copy/batch_insert_data_1417072335118.json' credentials 'aws_access_key_id=XXXXXXXXXXXXXXX;aws_secret_access_key=YyYYYyyYYYYYyyYYYYyyYYYYY' json 'AUTO' gzip ACCEPTINVCHARS ' ' TRUNCATECOLUMNS TRIMBLANKS;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With