There are usually two cases of importing hive table data to MySQL through Sqoop.
The first is to import all the data from a table on hive to the table in MySQL.
The second is to import some of the data from a table on hive to a table in MySQL.
The difference between the two approaches is that the second case requires specifying the name of the column to import the data into. The two cases are imported in the following ways:
1. Import All
Sqoop export--connect jdbc:mysql://127.0.0.1:3306/dbname--username mysql (mysql user name)--password 123456 (password)--table stud ENT (table on MySQL)--hcatalog-database SOPDM (schema on hive)--hcatalog-table Student (table on hive)
2. Partial Import
Sqoop export--connect jdbc:mysql://127.0.0.1:3306/dbname--username mysql (mysql user name)--password 123456 (password)--table stud ENT (table on MySQL)--columns "id,name,age"--hcatalog-database SOPDM (schema on hive)--hcatalog-table Student (table on hive)
Original: Import hive table data to MySQL using Sqoop
Sqoop hive Export to mysql[]