flink-cdc
flink-cdc copied to clipboard
The uniqueidentifier type in SQL Server cannot be compared using ObjectUtils.compare.
The uniqueidentifier type in SQL Server cannot be compared using ObjectUtils.compare. For example, in SQL Server, the value 'C6D6083A-4D2A-40D0-B20A-000005972E13' is considered less than 'B63D3AA7-8BC8-4C0F-BACD-FFFFFDAA57CD'.
DECLARE @uuid1 uniqueidentifier = 'C6D6083A-4D2A-40D0-B20A-000005972E13';
DECLARE @uuid2 uniqueidentifier = 'B63D3AA7-8BC8-4C0F-BACD-FFFFFDAA57CD';
SELECT CASE
WHEN BINARY_CHECKSUM(CAST(@uuid1 AS binary(16))) > BINARY_CHECKSUM(CAST(@uuid2 AS binary(16))) THEN 'uuid1 greater than uuid2'
WHEN BINARY_CHECKSUM(CAST(@uuid1 AS binary(16))) < BINARY_CHECKSUM(CAST(@uuid2 AS binary(16))) THEN 'uuid1 小于 uuid2'
ELSE 'uuid1 less than uuid2'
END AS result;�
Due to the incorrect comparison, the split chunks are terminated prematurely. Therefore, I have chosen to address this issue by using a SQL query specifically for this type.
@comien please refer https://ververica.github.io/flink-cdc-connectors/master/content/about.html#code-style
@comien Thanks for your contribution, Could you add test for this case?
@comien Hi, Can you rebase master and add unit test to confirm this fix worked?
Hi @comien, could you please rebase this PR with latest master branch before it could be merged?
This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.