Mysql – Using thesqldump on RDS to export a large file in TSV format

mysqldump

I would like to export a single, large table (30GB) from an RDS MySQL server on a regular basis into a TSV file, so that we can load the file into Vertica.

However, RDS doesn't provide a way to use mysqldump with the –tab=path option, so we need to parse/convert the INSERT statements to TAB seperated files.

I would like to convert lines from the dump file like this:

INSERT INTO MyTAble VALUES ('data_1','data_2', 'date_3'); 

to this
'data_1' 'data_2' 'data_3'

Since I need to parse through a 30G file, I would like to find the most efficient way of doing this?

Thanks for any help.

Best Answer

Assuming RDS with MySQL 5.6 is being used, mydumper may be a better option. The newer versions have the RDS grants limitation into account and you will get all the advantages of mydumper over mysqldump (compression, parallel execution, overall faster speed, etc).

This wouldn't provide TSV data, but by using the --chunk-filesize option you can split the data into multiple files in parallel and then process them in parallel afterwards

option:: --chunk-filesize -F Split tables into chunks of this output file size. This value is in MB