0
votes

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]
  -----------------------------------------------
1
Can you post your query as well, its zlib related error so looking at query might help identify the issue - mbaxi
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; - Tushar
Your source data is in simple text CSV format, specifying GZIP option suggests its in compressed format, try removing that option and perform copy - mbaxi

1 Answers

1
votes

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;