Sqoop Complete Tutorial Part-6

This is the continuation part of “Sqoop Complete Tutorial”. If you want to read –


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-import
–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.

 

6 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s