I'm trying to move a file from RedShift to S3. Is there an option to move this file as a .csv?

Currently I am writing a shell script to get the Redshift data, save it as a .csv, and then upload to S3. I'm assuming since this is all on AWS services, they would have an argument or something that let's me do this.

有帮助吗?

解决方案

Use the UNLOAD command. It will create at least one file per slice, you will have to merge the files by yourself.

unload ('__SQL__')
to 's3://__BUCKET__/__PATH__'
credentials 'aws_access_key_id=__S3_KEY__;aws_secret_access_key=__S3_SECRET__'
delimiter as ','
addquotes
escape
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top