Sqoop Job

Let’s study about the Sqoop job,

In this article will study how to create and maintain the Sqoop jobs.

* Sqoop job creates and saves the import and export commands.

* This concept mainly applicable on most frequently used commands.

* It is mainly used to recall the saved job.

* In Sqoop we can schedule the jobs using Sqoop job, so that we can run job

per our convenience.

* The incremental import uses re-executin or re-calling, which can import the updated rows from RDBMS table to HDFS.

1. Create Job

In this case we are creating a job with the name called “empjob”, which can import the table data from RDBMS table to HDFS.

Example

The below command explain how to create a job that is importing data from the employee table in the beyondcorner database to the HDFS file.

$ sqoop job –create empjob

–import

–connect jdbc:mysql://localhost/beyondcorner

–username “root”

–password “beyonduser”

–table “employee”

-m 1

2. Verify Job

In this case we are verifying the saved job using ‘–list’ argument.

Example

The below command is used to verify the list of saved Sqoop jobs.

$ sqoop job –list

Inspect Job

In this case we are verify particular jobs and their details using ‘–show’ argument.

Example

The below command is used to verify a job called “empjob”.

$ sqoop job –show empjob

3. Execute Job

In this case we are executing a saved job using ‘–exec’ option.

Example

The below command is used to execute a saved job called “empjob”.

$ sqoop job –exec empjob

4. Delete Job

In this case we are deleting created job called “empjob”

Example

The below command is used to delete created job called “empjob”.

$ sqoop job –delete empjob

 Reference

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_literal_sqoop_job_literal