DTStack / DTStack/chunjun

[Bug] [sqlservercdc-x] mssqlcdc_stream.sql获取的数据都是空的

Open
#1,439 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/DTStack/chunjun/issues) and found no similar issues.

### What happened

![image](https://user-images.githubusercontent.com/118407740/206338801-7a3e05f9-8fda-4a45-9152-5f72a9c17fc7.png)

### What you expected to happen

在local模式下运行,运行没有报错,但获取不了正常数据,都是空的。

### How to reproduce

一、环境准备
1、Microsoft SQL Server 2017 (RTM-CU21) (KB4557397) - 14.0.3335.7 (X64)
Jun 12 2020 20:39:00
Copyright (C) 2017 Microsoft Corporation
Enterprise Edition (64-bit) on Linux (CentOS Linux 7 (Core))
2、已开启CDC配置
3、source表结构:
![image](https://user-images.githubusercontent.com/118407740/206339315-fe31ab4c-642f-451c-860a-c57c46ae9c16.png)

二、配置脚本
[root@t-hadoop01 sql-script]# cat mssqlcdc_stream.sql
CREATE TABLE test_binlog
(
id varchar,
name varchar,
del_flag int,
create_user varchar,
create_date timestamp,
update_user varchar,
update_date timestamp
)WITH (
'connector'='sqlservercdc-x',
'username'='sa',
'password'='pawdxxx',
'cat' = 'insert,delete,update',
'url' = 'jdbc:sqlserver://hostip:1433;databaseName=GISS_TEST',
'table' = 'dbo.MKT_CITY',
'timestamp-format.standard' = 'SQL',
'database' = 'GISS_TEST',
'poll-interval' = '1000'
);

CREATE TABLE kafka_sink (
id varchar,
name varchar,
del_flag int,
create_user varchar,
create_date timestamp,
update_user varchar,
update_date timestamp
) WITH (
'connector' = 'stream-x'
);

INSERT INTO kafka_sink
SELECT *
FROM test_binlog u;

三、执行命令
[root@t-hadoop01 chunjun-dist112]# sh bin/chunjun-local.sh -job sql-script/mssqlcdc_stream.sql

四、运行结果
1、插入数据
insert into dbo.mkt_city(id,name,del_flag,create_user,create_date,update_user,update_date)
values('33','雅安33',0,'admin','2022-12-07 08:17:00','admin','2022-12-07 08:17:00');
2、运行结果
![image](https://user-images.githubusercontent.com/118407740/206339717-0a07ca04-306e-4305-89fe-68d4aebff4b5.png)

获取不到正常数据!

### Anything else

_No response_

### Version

1.12_release

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.