nifi 读取mysql_使用NIFI增量获取重复记录,(Duplicate records ingesting in incremental fetch using NIFI,)...

在设计使用Nifi获取MySQL增量数据的工作流时,遇到流重复摄取相同记录的问题。配置QueryDatabaseTable处理器时,尝试设置最大值列为createTime(时间戳)和ID,但仍然导致重复。解决方案是采用PutDatabaseRecord处理器替代原有流程,配合Incremental ingestion避免重复。
摘要由CSDN通过智能技术生成

使用NIFI增量获取重复记录,(Duplicate records ingesting in incremental fetch using NIFI,)

我正在设计一个工作流,以使用NIFI获取增量获取,源和目标数据库都在MySQL中。 处理器是QueryDatabaseTable和spiltAvro和convertAvroToJson以及convertJsonToSQL和PutSQL如下图

eN0KP.png

querydatabasetable的配置参数如下

NMc8Y.png

现在源数据库表只有200条记录,当我启动进程时,流重复地摄取相同的记录。

我已经将最大值列设置为createTime ,它是时间戳并且它的值是

2017-12-07 18:48:23

为所有200条记录。

我也用ID替换了最大值列 ,但也导致了同样的问题。 什么可能导致这种重复摄取?

I am designing a workflow to get an incremental fetch using NIFI the source and target databases are in MySQL. the processors are QueryDatabaseTable and spiltAvro and convertAvroToJson and convertJsonToSQL and PutSQL as below image

eN0KP.png

and the configuration parameters for querydatabasetable is as follows

NMc8Y.png

now the source database table has only 200 records, when I start the process the flow is ingesting the same records repeatedly.

I have set the maximum-value columns to createTime which is timestamp and the value for it is

2017-12-07 18:48:23

for all the 200 records.

I also replaced maximum-value columns with ID but that also resulted in same issue. What could be causing this repeated ingestion?

原文:https://stackoverflow.com/questions/47697393

2020-03-02 18:48

满意答案

根据@mattyb在NiFi中返回空值的covertJSONtoSQL中的建议,我用PutDatabaseRecord处理器替换了spiltAvr

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值