Yogzzz
Yogzzz

Reputation: 2795

Import HDFS data file into mysql

I am trying to import a large HDFS file into a mysql db. The data in the file is delimiter by a '^A'. How do I tell mysql to separate each column by ctrl-A? Also, is it possible for me to specify what fields I want to import.

Upvotes: 1

Views: 859

Answers (1)

Mike Brant
Mike Brant

Reputation: 71422

See the documentation here:

http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html

You are looking for the --fields-terminated-by=string option. There is not option to only select certain fields for import, though you can use --columns=column_list to map columns in your data to fields in the table.

Upvotes: 2

Related Questions