Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新数据时先删除再插入,使用批处理,删除数据后没有插入 #63

Open
ambitfly opened this issue Dec 8, 2022 · 2 comments

Comments

@ambitfly
Copy link

ambitfly commented Dec 8, 2022

-D[10.10.21.21, 8085, 视频源1, rtsp://xxxx@xxxx:554/Streaming/Channels/201, 3, {}, 1, 测试1, 位置123456, 测试用, 标签1, 198dae6f-7604-11ed-99d8-00155d3ba55a, null, null, 395211b3-7603-11ed-8e65-00155d3ba55a, 测试组, 2fe3b8de-7603-11ed-8e65-00155d3ba55a, 型号1, 17cef140-7603-11ed-8e65-00155d3ba55a, 视频源1]
+I[10.10.21.21, 8085, 视频源1, rtsp://xxxx123456@xxxx:554/Streaming/Channels/201, 3, {}, 1, 测试1, 位置123456, 测试用, 标签1, 198dae6f-7604-11ed-99d8-00155d3ba55a, 211be11a-7603-11ed-8e65-00155d3ba55a, 海康, 395211b3-7603-11ed-8e65-00155d3ba55a, 测试组, 2fe3b8de-7603-11ed-8e65-00155d3ba55a, 型号1, 17cef140-7603-11ed-8e65-00155d3ba55a, 视频源1]

把'sink.batch-size' 设置成1不会出现这样的问题

@itinycheng
Copy link
Owner

@ambitfly

问题原因:在同一个Batch中执行顺序为 insert > update > delete,参考代码:ClickHouseUpsertExecutor

默认配置sink.ignore-delete = true是不会去执行delete语句;

@ysq5202121
Copy link

@ambitfly 如果采取自增ID的方式应该是没有问题的,因为同一个ID不会有两条记录

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants