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
It is a bit of a workaround, but you need to make your query a subquery and include a limit. It will then output to one file. E.g.
select * from (select * from bizdata LIMIT 2147483647);
So basically you are selecting all from a limited set. That is the only way it works. 2147483647 is your max limit, as a limit clause takes an unsigned integer argument.
So the following will unload to one file:
unload(' select * from (
select bizid, data
from biztable
limit 2147483647);
') to 's3://.......' CREDENTIALS 'aws_access_key_id=<>;aws_secret_access_key=<>' csv ;