Simple application of Sqoop:
Requirements: First the data in the Hive data table WordCount into the MySQL database;
Hive Datasheet view:
Its file location in HDFs:
Build MySQL datasheet, we also called WordCount:
To build a table statement:
CREATE TABLE WordCount (
Name varchar (300),
ID int (one) DEFAULT 0
);
Import the data from the above hive into the MySQL database wordcount table:
Sqoop export--connect jdbc:mysql://icity0:3306/sqoop--username root--password root--table wordcount-- Input-fields-terminated-by ' t '--export-dir '/user/hive/warehouse/wordcount '
Note: If you use hive to perform the results of the data generated by MapReduce, the default delimiter is ' \001 ', which is ' \ t ' because of the data that is used here for HDFs import to hive, see Hive Use instance 1 Click to open the link;
/user/hive/warehouse The default location that is saved for the hive file.
As shown in the figure:
To view the MySQL database WordCount datasheet:
Support, Sqoop simple instance runs complete.