Dinky MySQLCDC 整库同步到 Doris

资源:flink 1.17.0、dinky 1.0.2、doris-2.0.1-rc04

问题:Cannot deserialize value of type int from String ,detailMessage=unknowndatabases ,not a valid int value

复制代码
2024-05-29 16:52:20.136 ERROR org.apache.doris.flink.table.DorisDynamicTableSink(468): Doris FE's response cannot map to schema. res: "errCode=7,detailMessage=unknowndatabases,dbName=default_cluster:mysql_sync" org.apache.doris.shaded.com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type int from String "errCode=7,detailMessage=unknowndatabases,dbName=default_cluster:mysql_sync": not a valid int value
at [Source: (String)""errCode=7,detailMessage=unknowndatabases,dbName=default_cluster:mysql_sync""; line: 1, column: 1]
at org.apache.doris.shaded.com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) ~[flink-doris-connector-1.17-1.4.0.jar:1.4.0]
at org.apache.doris.shaded.com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1991) ~[flink-doris-connector-1.17-1.4.0.jar:1.4.0]

解决:Doris要预先建表,而MySQLCDC 整库到 MySQL 则会自动建表

参考dinky整库同步_dinky整库实时同步-CSDN博客

doris sink表不会在首次执行自动建表,需要手动建doris表,再运行flinkcdc

FlinkSQL:

复制代码
EXECUTE CDCSOURCE demo_doris WITH (
  'connector' = 'mysql-cdc',
  'hostname' = '172.xxx',
  'port' = '3306',
  'username' = 'xxx',
  'password' = 'xxx',
  'checkpoint' = '10000',
  'scan.startup.mode' = 'initial',
  'parallelism' = '1',
  'database-name' = 'test',
  'table-name' = 'test\.student,',
  'sink.connector' = 'doris',
  'sink.fenodes' = '172.xxx:8030',
  'sink.username' = 'xxx',
  'sink.password' = 'xxx',
  'sink.doris.batch.size' = '1000',
  'sink.sink.max-retries' = '1',
  'sink.sink.db' = 'test',
  'sink.sink.enable-delete' = 'true',
  'sink.sink.properties.format' ='json',
  'sink.sink.properties.read_json_by_line' ='true',
  'sink.table.prefix' = 'test_',
  'sink.table.identifier' = '#{schemaName}.#{tableName}',
  'sink.sink.label-prefix' = '${idUtil.simpleUUID()}'
);
相关推荐
愚戏师31 分钟前
Python3 多线程
linux·运维·服务器·python
子午1 小时前
【食物识别系统】Python+TensorFlow+Vue3+Django+人工智能+深度学习+卷积网络+resnet50算法
人工智能·python·深度学习
曾经的三心草1 小时前
基于正倒排索引的Java文档搜索引擎2-实现Index类
java·python·搜索引擎
疏狂难除1 小时前
尝试rust与python的混合编程(二)
数据库·python·rust
子午2 小时前
【蘑菇识别系统】Python+TensorFlow+Vue3+Django+人工智能+深度学习+卷积网络+resnet50算法
人工智能·python·深度学习
Mr_Xuhhh2 小时前
pytest -- 指定⽤例执⾏顺序
开发语言·python·pytest
tokepson2 小时前
关于python更换永久镜像源
python·技术·记录
F_D_Z2 小时前
【解决办法】网络训练报错AttributeError: module ‘jax.core‘ has no attribute ‘Shape‘.
开发语言·python·jax
前端伪大叔2 小时前
第29篇:99% 的量化新手死在挂单上:Freqtrade 隐藏技能揭秘
后端·python·github
Aevget3 小时前
MyEclipse全新发布v2025.2——AI + Java 24 +更快的调试
java·ide·人工智能·eclipse·myeclipse