Question

I have my data store into hive table. i want to transfer hive tables selected data to mysql table using sqoop.

Please guide me how to do this?

Was it helpful?

Solution

check out the sqoop guide here

OTHER TIPS

You need to use sqoop export, here is the example

sqoop export --connect "jdbc:mysql://quickstart.cloudera:3306/retail_rpt_db" \
   --username retail_dba \
   --password cloudera \
   --table departments \
   --export-dir /user/hive/warehouse/retail_ods.db/departments \
   --input-fields-terminated-by '|' \
   --input-lines-terminated-by '\n' \
   --num-mappers 2 

sqoop export to export data to mysql from Hadoop.

  1. --connect JDBC url
  2. --username mysql username
  3. --password password for mysql user
  4. --table mysql table name
  5. --export-dir valid hadoop directory
  6. --input-fields-terminated-by column delimiter in Hadoop
  7. --input-lines-terminated-by row delimiter in Hadoop
  8. --num-mappers number of mappers to process the data
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top