Sqoop-将Hive ORC表导出到MySQL
全量:
sqoop export \ --connect jdbc:mysql://localhost:3306/test \ --username root \ --password 1234qwer \ --table company_test \ --hcatalog-database view_company \ --hcatalog-table company_test \ --hcatalog-partition-keys curdate \ --hcatalog-partition-values 20180122 \ -m 10
更新:
sqoop export \ --connect jdbc:mysql://localhost:3306/test \ --username root \ --password 1234qwer \ --table company_test \ --columns id,company \ --hcatalog-database view_company \ --hcatalog-table company_test \ --hcatalog-partition-keys curdate \ --hcatalog-partition-values 20180122 \ --update-key id \ --update-mode allowinsert \ -m 10
如果允许更新时插入:--update-mode allowinsert
如果只允许更新,不允许插入:--update-mode updateonly