문제

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