开发者社区 问答 正文

canal adapter 同步时使用 concat(字段1, 字段2) 作为_id,能同步新增,但

环境信息

canal version 1.1.3 mysql version 5.7 elasticsearch version 6.5.4

问题描述

canal adapter 同步时使用 concat(字段1, 字段2) 作为_id,能同步新增,但不能同步删除

步骤重现

配置如下:

dataSourceKey: defaultDS destination: example groupId: g1 esMapping: _index: test _type: _doc _id: _id upsert: true sql: "select concat(video_id,label_id) _id, video_id, label_id from test" etlCondition: commitBatch: 3000

原提问者GitHub用户zhechuan1

展开
收起
云上静思 2023-05-04 12:15:54 164 分享 版权
1 条回答
写回答
取消 提交回答
  • 复合主键不会直接删除es记录

    原回答者GitHub用户rewerma

    2023-05-05 10:34:19
    赞同 展开评论