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.
Below command shows import all tables from employee database
Tables
+--------------------+
| employee |
| employee_add |
| employee_contact|
Below command verify all the table data to the employee database in HDFS.
$ sqoop import-all-tables \
--connect jdbc:mysql://localhost/userdb \
--username root
It will show you the list of table names in employee database as indexes.$ $HADOOP_HOME/bin/hadoop fs -ls
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