MySql数据表直接到Hive表操作

常用配置:

bin/sqoop import 
--connect jdbc:mysql://ip:3306/database?tinyInt1isBit=false 
--username xxx 
--password xxx 
--table xxx 
--xxx 
--num-mappers 1 
--target-dir /xxx/xxx 
--delete-target-dir 
--direct 
--hive-import 
--hive-database xxx 
--hive-table xxx 
--fields-terminated-by '01' 

注:

1.如果导出的数据库是mysql 则可以添加一个 属性 --direct 

加上direct 属性在导出mysql数据库表中的数据会快一点 执行的是mysq自带的导出功能

2.设置

--num-mappers 参数大小

 
原文地址:https://www.cnblogs.com/-courage/p/14010198.html