From eba609cc313793f8b8cac290155f06e6bfa2028d Mon Sep 17 00:00:00 2001 From: gongzhongqiang Date: Tue, 23 May 2023 18:02:13 +0800 Subject: [PATCH] address comment --- .../connectors/sqlserver/source/utils/SqlServerTypeUtils.java | 3 +++ .../sqlserver/SqlServerStreamingChangeEventSource.java | 1 + 2 files changed, 4 insertions(+) diff --git a/flink-connector-sqlserver-cdc/src/main/java/com/ververica/cdc/connectors/sqlserver/source/utils/SqlServerTypeUtils.java b/flink-connector-sqlserver-cdc/src/main/java/com/ververica/cdc/connectors/sqlserver/source/utils/SqlServerTypeUtils.java index b8480d6a1c1..74a6ebfde3b 100644 --- a/flink-connector-sqlserver-cdc/src/main/java/com/ververica/cdc/connectors/sqlserver/source/utils/SqlServerTypeUtils.java +++ b/flink-connector-sqlserver-cdc/src/main/java/com/ververica/cdc/connectors/sqlserver/source/utils/SqlServerTypeUtils.java @@ -65,6 +65,9 @@ private static DataType convertFromColumn(Column column) { return DataTypes.DATE(); case Types.TIMESTAMP: case Types.TIMESTAMP_WITH_TIMEZONE: + return column.length() >= 0 + ? DataTypes.TIMESTAMP(column.length()) + : DataTypes.TIMESTAMP(); case Types.BOOLEAN: return DataTypes.BOOLEAN(); default: diff --git a/flink-connector-sqlserver-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java b/flink-connector-sqlserver-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java index 0f68090120b..40b9ccc1fd4 100644 --- a/flink-connector-sqlserver-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java +++ b/flink-connector-sqlserver-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java @@ -46,6 +46,7 @@ import java.util.stream.Collectors; /** + * Copied from Debezium project(1.6.4.final) to add method {@link SqlServerStreamingChangeEventSource#afterHandleLsn(SqlServerOffsetContext)}. * A {@link StreamingChangeEventSource} based on SQL Server change data capture functionality. A * main loop polls database DDL change and change data tables and turns them into change events. *