SQOOP Complete Tutorial Part-6

This is the continuation part of “Sqoop Complete Tutorial”.

18) Importing a table from MySQL to Hive’s default database.  

Importing a table from MySQL to Hive’s default database. The below command will help in copying “emp” table and data from MySQL to Hive “default” database as “employee”.

sqoop import
–connect jdbc:mysql://localhost/empdept
–table emp
–username root
–password cloudera
–hive-table employees

Verifying the data:  
















19) Importing a table from MySQL to Hive’s user database.  
Importing a table from MySQL to Hive’s default database. The below command will help in copying “emp” table and data from MySQL to Hive’s user database (dbTest) as “employee” table.  

sqoop import
–connect jdbc:mysql://localhost/empdept
–table emp
–username root
–password cloudera
–hive-import
–hive-table employees
–hive-database dbTest

Verifying the data:  










Please click here for the next part.