问题
I wanted to unload from one database(production) and reload into another database(QA) in Redshift having exact same schema.
I issued S3 load command as following.
copy table(col1,col2,col3,col4) from 's3://<bucket_path>/<file_name>.gzip' CREDENTIALS 'aws_access_key_id=<your_key>;aws_secret_access_key=<your_secret>' delimiter '|' gzip NULL AS 'null_string';
Got following error.
ERROR: Failed writing body (0 != XXX) Cause: Failed to inflateinvalid or incomplete deflate data. zlib error code: -3
error: Failed writing body (0 != XXX) Cause: Failed to inflateinvalid or incomplete deflate data. zlib error code: -3
code: 9001
context: S3 key being read : s3://<some_s3_bucket>/<some_s3_bucket_file>
query: XXXXX
location: table_s3_scanner.cpp:355
process: query1_23 [pid=2008]
-----------------------------------------------
回答1:
This happens when you are trying to use Gzip file during copy and it cannot read the file as a Gzip.
If I’ve made a bad assumption please comment and I’ll refocus my answer.
来源:https://stackoverflow.com/questions/45906216/error-while-importing-data-into-redshift