Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Oozie Essentials

You're reading from  Apache Oozie Essentials

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781785880384
Pages 164 pages
Edition 1st Edition
Languages
Author (1):
Jagat Singh Jagat Singh
Profile icon Jagat Singh

Running Sqoop command line


The syntax for the Oozie Sqoop command-line execution is shown in the following screenshot:

Sqoop command line

Let's import all records for the table to HDFS.

Note

For sample MySQL database preparation, I have created one script in the folder <BOOK_CODE_HOME>/ch07/sqoop_commandline/loadToMySQL.sh, using which you can create one database to test the Sqoop import.

The database name is rainfall and table is rainfall_data. We can import all the records from this table using the Sqoop command-line import option. To create the test Dataset, execute the steps written in loadToMySQL.sh.

We are ready to run the job. I have saved the following command in the script <BOOK_CODE_HOME>/ch07/sqoop_commandline/import_all_records.sh:

oozie sqoop -oozie http://localhost:11000/oozie -command import --
connect jdbc:mysql://localhost:3306/rainfall --username root --
password "" --table rainfall_data --target-dir 
'/user/hue/learn_oozie/ch07/sqoop_commandline/rainfall/output' ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}