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]
    '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:

Have more questions? Submit a request


Please sign in to leave a comment.

** Aginity, Inc.’s Provision of Scripts and Similar Materials at Help Desk Center. For the convenience of Aginity Amp™ clients, we provide code snippets, scripts and similar materials at this Help Desk Center. Such materials are reference materials provided for illustration purposes only. These are intended to serve as an example for self-service clients and are generally geared to respond to common questions asked by similar clients. Such materials constitute Aginity’s intellectual property. Aginity Amp clients and their authorized users are permitted to use these materials in connection with their software license and/or subscription of Aginity Amp. Nothing herein shall limit Aginity’s right to use, develop, enhance, modify or market any of these materials as part of its business. These materials are not formally supported by Aginity or its affiliates. Usage of these materials does not guarantee any specific results, uptime, performance or error-free operation. Aginity disclaims all warranties of any kind, whether express, implied, statutory or otherwise, including any implied warranty of merchantability or fitness for a particular purpose.

Powered by Zendesk