Sqoop Complete Tutorial Part-12

So far, we’ve looked at a variety of instances in which the same arguments are supplied several times. The arguments are mostly what you need to know when dealing with Sqoop. If the correct inputs are supplied, the required task will be completed without problems. This post is part of the “Sqoop Complete Tutorial” series, and it will show you how to export tables from Hive to MySQL and Oracle.

Example:
sqoop export
–connect jdbc:mysql://localhost/NewTestDB
–username root
–password cloudera
–table Emp
–hcatalog-database dbtest
–hcatalog-table emp

If the table does not already exist in the destination, you will receive the following error:
ERROR manager.SqlManager: Error executing statement:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Table ‘NewTestDB.test’ doesn’t exist

Also, while supplying the table, database, and column names, keep in mind that case (case sensitivity) matters.

The arguments will be same except the connection strings.
If it is PostgreSQL, use “jdbc:postgresql://”
If it is Oracle, use “jdbc:oracle://”
If it is MySQL, use “jdbc:mysql://”

This slideshow requires JavaScript.


Hope you find this article helpful.

Please subscribe for more interesting updates.

1 comments

Leave a Reply