yuxiqian commented on code in PR #3497: URL: https://github.com/apache/flink-cdc/pull/3497#discussion_r1694407945
########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/main/java/org/apache/flink/cdc/connectors/sqlserver/source/dialect/SqlServerChunkSplitter.java: ########## @@ -61,11 +62,30 @@ public class SqlServerChunkSplitter implements JdbcSourceChunkSplitter { private final JdbcSourceConfig sourceConfig; private final JdbcDataSourceDialect dialect; + private static final String UNIQUEIDENTIFIRER = "uniqueidentifier"; + public SqlServerChunkSplitter(JdbcSourceConfig sourceConfig, JdbcDataSourceDialect dialect) { this.sourceConfig = sourceConfig; this.dialect = dialect; } + private static String reverse(String text) { + String[] arrs = text.split("-"); + List<String> arrList = Arrays.asList(arrs); + Collections.reverse(arrList); + arrs = arrList.toArray(new String[0]); + return String.join("-", arrs); + } + + public static int compare(Object obj1, Object obj2, Column splitColumn) { + if (splitColumn.typeName().equals(UNIQUEIDENTIFIRER)) { + String sObj1 = reverse(obj1.toString()); + String sOjb2 = reverse(obj2.toString()); + return ObjectUtils.compare(sObj1, sOjb2); + } + return ObjectUtils.compare(obj1, obj2); + } Review Comment: Will it be better if we rename them to `reverseUuid` / `compareUuid`, and move these utility functions to `org.apache.flink.cdc.connectors.sqlserver.source.utils` package? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java: ########## @@ -209,7 +209,8 @@ public boolean executeIteration( // situation if (!toLsn.isAvailable()) { LOGGER.warn( - "No maximum LSN recorded in the database; please ensure that the SQL Server Agent is running"); + "{} No maximum LSN recorded in the database; please ensure that the SQL Server Agent is running", + dataConnection.connectionString()); Review Comment: Is this change related to this PR? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/main/java/org/apache/flink/cdc/connectors/sqlserver/source/dialect/SqlServerChunkSplitter.java: ########## Review Comment: It would be nice if we can add some test cases to verify UUID comparison logic. [Test cases from Microsoft docs](https://learn.microsoft.com/en-us/sql/connect/ado-net/sql/compare-guid-uniqueidentifier-values?view=sql-server-ver16) would be ideal. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org