Can you remove 000 file extension after a CSV unload from Amazon Redshift to S3 [duplicate]

I've code which extracts data from redshift to S3

UNLOAD ('
select sysdate
')
TO 's3://test-bucket/adretarget/test.csv' CREDENTIALS 'aws_access_key_id=ABCDE;aws_secret_access_key=12345'
ALLOWOVERWRITE
delimiter ','
PARALLEL OFF ;

It works ok, however all my files end .csv000 is there a way to exclude the 000 so they just end.csv

Thanks

2

1 Answer

 UNLOAD ('
select sysdate
')
TO 's3://test-bucket/adretarget/test' CREDENTIALS 'aws_access_key_id=ABCDE;aws_secret_access_key=12345'
ALLOWOVERWRITE
delimiter ','
PARALLEL OFF ;


There is no need to add the .csv extension in your unload file name. You can just mention 'test' and it will unload your data without extension, but the file will still be comma separated, which is csv.

3

You Might Also Like