1、sqoop 导入hive数据
(1)空字符串, 空对象处理
--null-string '\\N' --null-non-string '\\N'
(2)导入数据含有特殊字符
--hive-drop-import-delims
(3)导入时 用query查询
target-dir 一定不要与数据库最终保存位置一致
2、sqoop 导出到MySQL
(1)导入时定义过空对象、空字符创处理、
--input-null-string '\\N'--input-null-non-string '\\N'
(2)mapper100%,reduce卡在0%
id主键冲突,由特殊字符导致hdfs文件格式有问题\
(3)export导出,增量更新
update-key update-mode
例子: --update-key id --update-mode allowinsert
两种模式: allowinsert : 如果key是主键,则MySQL存在则更新,不存在则插入;不是主键,则插入;
updateonly : 只会更新,不会插入;
3、使用java调用
(1)一定要注以特殊字符转义
\\N \\\\\\N