redshift-cmd¶
setup¶
create cluster¶
aws redshift create-cluster \
--cluster-identifier my-redshift-test \
--node-type dc2.large \
--master-username awsuser \
--master-user-password passworD.1 \
--cluster-type single-node \
--number-of-nodes 1 \
--publicly-accessible
# --load-sample-data ??
unload¶
- https://docs.aws.amazon.com/zh_cn/redshift/latest/dg/t_unloading_encrypted_files.html
- https://hevodata.com/learn/redshift-unload-command-usage-and-examples/#r2
CSE:
unload ('select * from dev.public.customer')
to 's3://template1-rs3bucket-1bor4w2qr4rti/unload_encrypted/'
iam_role 'arn:aws:iam::012345678901:role/RedshiftImmersionRole'
master_symmetric_key 'MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEK'
encrypted;
SSE:
create database¶
create table¶
create table table_utf8(
col1 integer not null,
col2 varchar(100) not null ,
col3 varchar(100) not null
);
insert into table_utf8 values
( 1,'中文1','中文2'),
( 2,'中文1','中文2'),
( 3,'中文1','中文2');