Redshift

447
  1. Tool: https://app.jackdb.com

 

2. Copy data from S3

copy supplier from ‘s3://us-west-2-aws-training/awsu-spl/redshift-quest/supplier/supplier.json’ CREDENTIALS ‘aws_access_key_id=<YOUR-ACCESS-KEY-ID>;aws_secret_access_key=<YOUR-SECRET-ACCESS-KEY>’ lzop delimiter ‘|’ COMPUPDATE ON manifest;

Check collum:

 

3. Debug

select * from stl_load_errors;

// Create view

create view loadview as (select distinct tbl, trim(name) as table_name, query, starttime, trim(filename) as input, line_number, colname, err_code, trim(err_reason) as reason from stl_load_errors sl, stv_tbl_perm sp where sl.tbl = sp.id);

 

4. Load from remote

wget https://redshift-demo.s3.amazonaws.com/tpc-h/100lzo/supplier_data/supplier.data

copy supplier_remote_load from ‘s3://<YOUR-BUCKET>/manifest.json’ credentials ‘aws_access_key_id=<YOUR-ACCESS-KEY-ID>;aws_secret_access_key=<YOUR-SECRET-ACCESS-KEY>’ delimiter ‘|’ COMPUPDATE ON ssh;

Manifest.json

 

dfd