部分和重复记录,而sqoop导入 [英] Partial and duplicate records while sqoop import

查看:326
本文介绍了部分和重复记录,而sqoop导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




  • - 查询 - 自定义查询

  • - split-by - 非整数列(char)

  • - num-mappers - 超过2




验证源数据计数说1000记录



验证导入数据计数表示1923记录



解决方案

使用 split-by 时,字段是非整数。



Sqoop使用TextSplitter提供如下警告:

  WARN db.TextSplitter:如果您的数据库以不区分大小写的顺序排序,则可能会导致部分导入或重复记录

WARN db.TextSplitter:强烈建议您选择一个整合的分割列。




  • 解决方案1:使用单个映射器或2

  • 解决方案2:在查询中使用排名函数,并使用排名字段

  • 中的 - split-by 解决方案3:在查询中按升序排列 - split-by 字段


Sqoop import is resulting in duplicate/partial records when we are using the following setting

  • --query - Custom Query
  • --split-by - Non-integer column (char)
  • --num-mappers - More than 2

Verified the source data count say 1000 records

Verified the import data count say 1923 records

解决方案

When using the split-by and field is non integer .

Sqoop uses TextSplitter which provides a warning as follows :

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. 

  • solution 1: use single mapper or 2
  • solution 2: use rank function in the query and use the --split-by on the rank field
  • solution 3: sort the --split-by field in ascending order in the query

这篇关于部分和重复记录,而sqoop导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆