手順
aws s3api put-object --bucket awssampledb --key "auto-copy-lineorder/"
CREATE TABLE public.lineorder
(
lo_orderkey INTEGER NOT NULL,
lo_linenumber INTEGER NOT NULL,
lo_custkey INTEGER NOT NULL,
lo_partkey INTEGER NOT NULL,
lo_suppkey INTEGER NOT NULL,
lo_orderdate INTEGER NOT NULL,
lo_orderpriority VARCHAR(15) NOT NULL,
lo_shippriority VARCHAR(1) NOT NULL,
lo_quantity INTEGER NOT NULL,
lo_extendedprice INTEGER NOT NULL,
lo_ordertotalprice INTEGER NOT NULL,
lo_discount INTEGER NOT NULL,
lo_revenue INTEGER NOT NULL,
lo_supplycost INTEGER NOT NULL,
lo_tax INTEGER NOT NULL,
lo_commitdate INTEGER NOT NULL,
lo_shipmode VARCHAR(10) NOT NULL
);
-- COPY JOB DROP copy_lineorder01;
COPY public.lineorder FROM 's3://awssampledb/auto-copy-lineorder/'
IAM_ROLE 'arn:aws:iam::1234567890123:role/redshift-spectrum-s3-fullaccess'
gzip compupdate off region 'ap-northeast-1'
JOB CREATE copy_lineorder01
AUTO ON;
COPY JOB LIST;
aws s3 cp s3://awssampledb/ssbgz/lineorder0000_part_00.gz s3://awssampledb/auto-copy-lineorder/
SELECT count(*) FROM public.lineorder;
SELECT * from SYS_LOAD_HISTORY;
その他
select * from stl_load_errors;
COPY JOB RUN copy_lineorder01;