cds icon indicating copy to clipboard operation
cds copied to clipboard

null字段添加Nullable配置,否则同步mysql回报nil异常;增加bit类型go处理

Open googlefan opened this issue 2 years ago • 5 comments

在同步mysql数据时候,发现当字段可以为Null,并且数据是Null的时候,dm 数据同步报nil异常的异常

{"@timestamp":"2021-01-04T17:03:44.268+08","level":"error","content":"mysqltypeconv.go:59 sql: Scan error on column index 4, name "Default": converting NULL to string is unsupported"}

通过如下代码可以解决

googlefan avatar May 17 '22 03:05 googlefan

这是个很好的建议,但是一些配置文件的改动是因为什么呢

icy4ever avatar May 20 '22 04:05 icy4ever

这是个很好的建议,但是一些配置文件的改动是因为什么呢

上传多了好像,那些是我自己 用的配置,我应该只想推第一个commit 的4a237dc474065ead6a7a6fc8572d418a7136b5ce 已删除多余的提交

googlefan avatar May 22 '22 06:05 googlefan

这是个问题 但是Nullable类型可能会导致clickhouse 查询新能下降。

org0000h avatar May 24 '22 06:05 org0000h

嗯是的,官方文档确实说了 不建议使用Nullable,但是这应该从源头数据做保证,或者说同步时候数据清洗一遍; 还有一个异常 稍后我再提一个,就是程序对Mysql bit 类型数据没有做特殊处理,导致异常,在string类型转换时 \x00 \x01会出错

googlefan avatar May 25 '22 10:05 googlefan

希望你能补充一些测试

org0000h avatar May 27 '22 03:05 org0000h