sqoop 导入时的部分和重复记录

Partial and duplicate records while sqoop import

当我们使用以下设置时,Sqoop 导入会生成 duplicate/partial 条记录

Verified the source data count say 1000 records

Verified the import data count say 1923 records

当使用 split-by 且字段为非整数时。

Sqoop 使用 TextSplitter 提供如下警告:

WARN db.TextSplitter: If your database sorts in a case-insensitive order, this may result in a partial import or duplicate records

WARN db.TextSplitter: You are strongly encouraged to choose an integral split column. 
  • 解决方案 1:使用单个映射器或 2
  • 解决方案 2:在查询中使用排名函数并在排名字段
  • 上使用 --split-by
  • 解决方案 3:在查询中按升序对 --split-by 字段进行排序