Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

Sqoop Export

In previous cases, flow of data was from RDBMs to HDFS. Using “export” tool, we can import data from HDFS to RDBMs. Before performing export, Sqoop fetches table metadata from MySQL database. Thus we first need to create a table with required metadata.

Table creation in MySQL

  1. mysql>Create table table_name( column_name column_type )

Export query is shown below:

  1. Sqoop query sqoop export \ –connect jdbc:mysql://localhost/cloudera\ –username cloudera -P \ –table exported \ –export-dir /user/country_imported/part-m-00000

Now, see output in MySQL by following code.

  1. mysql> select * from exported