使用flink-cdc-3.2.1实时同步sqlserver2019数据库名称有特殊字符问题

报错:The db history topic or its content is fully or partially missing. Please check database history topic configuration and re-execute the snapshot.

使用flink-cdc-3.2.1实时同步sqlserver2019数据库到mysql8,SqlServer数据库是一个运行很久的数据库,数据库名称中包含特殊字符减号,同步作业报错。

我们在这个SqlServer上新建的数据库,数据库名称中没有特殊字符,同步作业可以正常实时同步。

出现这样问题,是什么原因,怎么解决?

下边是报错的flinksql:
CREATE TABLE t5(
uuid string ,
product_name string,
weight_date string,
car_no string,
consign_unit string,
gross_weight_id string,
PRIMARY KEY (uuid) NOT ENFORCED
)WITH(
'connector' = 'sqlserver-cdc',
'hostname' = '10.6.1.34',
'port' = '1433',
'username' = 'sa',
'password' = 'fsjldb',
'database-name' = 'db-web-pound',
'table-name' = 'dbo.db_measure_infos_20250305',
'server-time-zone'='Asia/Shanghai'
);

CREATE TABLE t6(
uuid string ,
weight_date string,
weight_time string,
PRIMARY KEY (uuid) NOT ENFORCED
)WITH(
'connector' = 'sqlserver-cdc',
'hostname' = '10.6.1.34',
'port' = '1433',
'username' = 'sa',
'password' = 'fsjldb',
'database-name' = 'db-web-pound',
'table-name' = 'dbo.db_weight_infos_20250305',
'server-time-zone'='Asia/Shanghai'
);

CREATE TABLE tt5(
id string,
weight_date string,
material_type string,
vehicles_license string,
dispatcher string,
one_test_time timestamp(3),
PRIMARY KEY (id) NOT ENFORCED
)WITH(
'connector' = 'jdbc',
'driver' = 'com.mysql.cj.jdbc.Driver',
'url' = 'jdbc:mysql://10.6.1.82:3306/logistics',
'table-name' = 'db_weight_one_real_time',
'username' = 'furnace',
'password' = 'furnace'
);

insert into tt5(id,weight_date,material_type,vehicles_license,dispatcher,one_test_time)
select
t5.uuid
,t5.weight_date
,t5.product_name
,t5.car_no
,t5.consign_unit
,TO_TIMESTAMP(CONCAT(t6.weight_date, ' ', t6.weight_time),'yyyy-MM-dd HH:mm:ss.SSS')
FROM t5
LEFT JOIN t6 ON t5.gross_weight_id = t6.uuid;

展开
收起
游客hhixpo6h6hnw6 2025-03-05 16:32:53 118 分享 版权
0 条回答
写回答
取消 提交回答

实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。

还有其他疑问?
咨询AI助理