将Mysql数据导入Hive中
命令:
1 | sqoop import |
整库导入
1 | sqoop import-all-tables --connect jdbc:mysql://211.159.172.76:3306/ --username root --password 125323Wkq --hive-database solo -m 10 |
sqoop import-all-tables -Dorg.apache.sqoop.splitter.allow_text_splitter=true –connect jdbc:mysql://211.159.172.76:3306/solo –username root –password 125323Wkq –hive-database blog –create-hive-table –hive-import –hive-overwrite -m 10
单表导入
sqoop import –connect jdbc:mysql://211.159.172.76:3306/solo –username root –password 125323Wkq –table b3_solo_article –target-dir /blog/article –hive-import –hive-database blog
–fields-terminated-by “\t” –hive-table article –hive-overwrite
–m 10
sqoop import –connect jdbc:mysql://211.159.172.76:3306/solo –username root –password 125323Wkq –table b3_solo_article –target-dir /blog/article –hive-import –hive-database blog –create-hive-table –hive-table article –hive-overwrite -m 1