I am working on POC where we need to get the data from MySQL Db to Hive partitioned table then need to transfer the data to the table which is MySQL DB. I have created the table which supports acid properties and partitioned by year and month. So currently i am not able to transfer the data to MySQL DB. So can some one suggest me how can i achieve this?
1 Answers
0
votes
You can use Sqoop import to transfer the table data to hive by below:
sqoop import --connect <connection string>
--username <>
-P
--table <table name>
--target-dir <location> <table name>
--fields-terminated-by ","
--hive-import
--create-hive-table
--hive-table <hive table name
Then You can export the data back to my sql using Export in place of import.
$ sqoop export \
--connect <connect string>\
--username \
-P
--table <hive table>\
--export-dir <location