DataX数据同步- 不同时间Where条件
DataX数据同步工具
一、介绍:DataX是用来数据同步得第三方工具,能够进行分片,高效得数据同步
二、时间自增,根据时间进行数据同步:
1. 相关截图:
2. where 条件处理:主要分为三个数据库的数据同步,不同的处理
1. postgresqlreader: ic_shopee_shopperformance "where": "customer_id = 1 AND ((lastmodificationtime < REPLACE (${currentTime},'%',' ')::timestamp AND lastmodificationtime >= REPLACE (${lastTime},'%',' ')::timestamp - interval '1 day') OR (creationtime < REPLACE (${currentTime},'%',' ') ::timestamp AND creationtime >= REPLACE (${lastTime},'%',' ')::timestamp - interval '1 day' ) )", 2. mysqlreader:t_mercadolibre_product_publish_execute "where": "customer_id = 1 AND ((update_time<replace(${currentTime},'%',' ') AND update_time>= DATE_ADD(replace(${lastTime},'%',' '), INTERVAL 1 DAY)) or (create_time<replace(${currentTime},'%',' ') AND create_time>= DATE_ADD(replace(${lastTime},'%',' '),INTERVAL 1 DAY)))", 3. sql server :pp_phoenixplan_ebay_autooff_queue "where": "CustomerId = 1 AND LastModificationTime<replace(${currentTime},'%',' ') AND LastModificationTime>= DATE_SUB(replace(${lastTime},'%',' '), interval 24 HOUR)",
解析:
currentTime:是增量开始时间
lastTime: 也是系统自定义事件
谢谢学习