sqoop Sqoop Import Import-All-Tables


SQOOP provides facility to import all tables

sqoop import-all-tables \
--connect <rdbms-jdbc-url> \
--username <username> \
--password <password> \
--hive-import \
--create-hive-table \
--hive-database <dbname> \
--warehouse-dir <warehouse-dir>

Important points to note on differences between import and import-all-tables:

Need to provide --warehouse-dir=//stage.db database name as input parameter to download all tables into a database. In sqoop import we will be providing only --target-dir not the --warehouse-dir


sqoop import-all-tables --connect="jdbc:mysql://serverip:3306/dbname" 
--username=xxx --password=yyy 
-m 1 --hive-import 
--hive-database dbname 
--hive-home /user/hive/warehouse