Error: while Importing data into Redshift

amazon-redshift sql sqlbulkcopy

Question

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
1
12/6/2017 6:53:40 AM

Accepted Answer

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.

1
8/31/2017 8:16:03 PM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow