我在SQL中运行以下查询。我正在尝试将数据从Redshift卸载到我的个人S3帐户中的存储桶中:
UNLOAD ('SELECT * FROM table WHERE
UPPER(description) LIKE \'%something%\')
TO 's3://mybucketname/sometextname.txt' CREDENTIALS
'aws_access_key_id=xxx;aws_secret_access_key=xxx'
PARALLEL OFF
当我这样做时,我收到以下错误:
您尝试访问的存储区必须使用指定的端点进行寻址。请将所有未来请求发送到此端点。状态301,错误PermanentRedirect,Rid AE9F82CD626A5B05,ExtRid 1hl5HHhv9rkaq0Vw7fB0kpm2WO1uOmy4MmXq
我的s3路径是否正确?我是否需要更改s3帐户或存储桶的某些权限?
答案 0 :(得分:1)
现在支持此功能。 https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html
unload ('select * from category')
to 's3://your-bucket/your-prefix'
iam_role 'arn:aws:iam::xxxxxxxx:role/redshift-role'
region 'us-west-2';