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

后端 未结 5 527
醉话见心
醉话见心 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:08

    There is no way to force Redshift to generate only a single output file, for sure.

    Under a standard UNLOAD you will have output files created equivalent to the number of system slices, i.e. a system with 8 slices will create 8 files for a single unload command(This is the fastest method to unload.)

    If you add a clause PARALLEL OFF in to he Unload Command, your output will be created as a single file, upto the time where the data extract soze does not go beyond 6.25GB, after which Redshift will automatically break the file into a new chunk.

    The same thing holds true, if you produce compressed output files as well(There of course you will have greater chances to produce a single output file, considering that your file can accommodate more number of records in it.).

提交回复
热议问题