How to unload a table on RedShift to a single CSV file?

后端 未结 5 526
醉话见心
醉话见心 2021-02-02 11:36

I want to migrate a table from Amazon RedShift to MySQL, but using \"unload\" will generate multiple data files which are hard to imported into MySQL directly.

Is there

5条回答
  •  孤城傲影
    2021-02-02 12:30

    In order to send to a single file use parallel off

    unload ('select * from venue')
    to 's3://mybucket/tickit/unload/venue_' credentials 
    'aws_access_key_id=;aws_secret_access_key='
    parallel off;
    

    Also I recommend using Gzip, to make that file even smaller for download.

    unload ('select * from venue')
    to 's3://mybucket/tickit/unload/venue_' credentials 
    'aws_access_key_id=;aws_secret_access_key='
    parallel off
    gzip;
    

提交回复
热议问题