Creating and executing Sqoop job
Sqoop provides you the facility to store certain jobs that can be used easily. In this recipe, we are going to see how to create a job and execute the same.
Getting ready
To perform this recipe, you should have a Hadoop cluster running with you as well as the latest version of Sqoop installed on it. Here I am using Sqoop 1.4.6. We would also need a MySQL database to be present in the network. Installing Sqoop is easy by downloading Sqoop tar ball and setting it in system path. As we are going to import data from MySQL, we would also need to download MySQL connector. Based on your MySQL version, download the right connector jar and copy it into the lib
directory of Sqoop installation.
How to do it...
We will create a
sqoop job
for incremental import that we performed in the last recipe. Following is the command to create asqoop
job:sqoop job \ --create incremental_import_job \ -- import \ --connect jdbc:mysql://localhost/company \ --username root \ --password...