Command for Importing from S3 Bucket

A common need is getting data into Redshift from the Amazon Simple Storage Service (S3 Bucket) using the Aginity Workbench for Redshift. Here is some basic information to get you started.  
 

  1. First you will need to upload your data file(s) to your S3 Bucket.
  2. Next you need to create the target table to load this data. I typically steal the DDL from the source system and tweak it for Redshift (typically just adding DISTKEY definition).
  3. Then you use a command that looks like this:

    copy [schema].[table_name]
    from
    's3://my.S3.domain/sub folder/filename.ext'
    credentials 'aws_access_key_id=XXXXXXXXXXXXXXX;aws_secret_access_key=yyyyyyyyyyyyyyyyyyyy'
    maxerror as 10 delimiter '|' GZIP;

 
You can find details of this command at the following:
http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html#r_COPY-copy-from-amazon-s3-synopsis

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk