0

I have encountered following error when trying to load a file from S3 to my redshift tables using copy command and unable to find any clue regarding this.

  -----------------------------------------------
  error:  Failed writing body (0 != 776) Cause: Failed to inflateinvalid or incomplete deflate data. zlib error code: -3
  code:      9001
  context:   S3 key being read : s3://redshift-dev-sandbox/Moores.csv
  query:     2565852
  location:  table_s3_scanner.cpp:356
  process:   query0_33 [pid=10565]
  -----------------------------------------------
3
  • 1
    Can you post your query as well, its zlib related error so looking at query might help identify the issue Commented Jul 20, 2016 at 7:08
  • My copy command query as follows: copy "aw_tushar_allentity".dataset_customerdataset from 's3://redshift-dev-sandbox/Moores.csv' credentials 'aws_access_key_id=xxxx;aws_secret_access_key=xxxx' delimiter ',' CSV IGNOREHEADER 1 GZIP; Commented Jul 20, 2016 at 7:15
  • 1
    Your source data is in simple text CSV format, specifying GZIP option suggests its in compressed format, try removing that option and perform copy Commented Jul 20, 2016 at 7:20

1 Answer 1

1

There is a mix up : You cannot specifying a GZIP algorithm on a simple csv file.

You will either have a copy of a csv file:

copy "aw_tushar_allentity".dataset_customerdataset from 's3://redshift-dev-sandbox/Moores.csv' 
credentials 'aws_access_key_id=xxxx;aws_secret_access_key=xxxx'
delimiter ',' CSV IGNOREHEADER 1;

or if your file is compressed from GZIP file:

copy "aw_tushar_allentity".dataset_customerdataset from 's3://redshift-dev-sandbox/Moores.csv.gz' 
credentials 'aws_access_key_id=xxxx;aws_secret_access_key=xxxx'
gzip
delimiter ',' CSV IGNOREHEADER 1;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.