...

Cloud Computing - Sqoop

Back to Course

Lesson Description


Lession - #792 Sqoop Import-All-Tables


This part portrays how to import every one of the tables from the RDBMS database server to the HDFS. Each table information is put away in a different catalog and the index name is same as the table name.

Syntax

Below syntax for import all tables
$ sqoop import-all-tables (generic-args>
(import-args>
$ sqoop-import-all-tables (generic-args>
(import-args>

Example

Allow us to take an instance of bringing in all tables from the employee information base. The list of tables that the database employee contains is as per the following.
 Tables        
  +--------------------+
 |     employee        | 
 |     employee_add    |    
 |     employee_contact|  
Below command shows import all tables from employee database
$ sqoop import-all-tables \
--connect jdbc:mysql://localhost/userdb \
--username root
Below command verify all the table data to the employee database in HDFS.
$ $HADOOP_HOME/bin/hadoop fs -ls
It will show you the list of table names in employee database as indexes.

Output

drwxr-xr-x - hadoop supergroup 0 2014-12-22 22:50 _sqoop
drwxr-xr-x - hadoop supergroup 0 2014-12-23 01:46 employee
drwxr-xr-x - hadoop supergroup 0 2014-12-23 01:50 employee_add
drwxr-xr-x - hadoop supergroup 0 2014-12-23 01:52 employee_contact