You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/SqlServerSchemaChangeResolver.java
+43-17Lines changed: 43 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,9 @@ public class SqlServerSchemaChangeResolver implements SchemaChangeResolver {
Copy file name to clipboardExpand all lines: seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/SqlServerSchemaChangeResolverTest.java
Copy file name to clipboardExpand all lines: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-sqlserver-e2e/src/test/java/org/apache/seatunnel/e2e/connector/cdc/sqlserver/SqlServerCDCIT.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -794,8 +794,7 @@ public void testWithSchemaEvolution(TestContainer container) {
Copy file name to clipboardExpand all lines: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-sqlserver-e2e/src/test/resources/ddl/sqlserver_schema_change_rename_columns.sql
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,19 @@ EXEC sys.sp_cdc_enable_table
30
30
@capture_instance ='dbo_products_v4',
31
31
@supports_net_changes =0;
32
32
33
+
-- SQL Server exposes sp_rename as a capture-instance switch. SeaTunnel now
34
+
-- treats it conservatively as ADD + DROP unless the downstream sink can
35
+
-- preserve existing values itself, so force real post-switch row updates under
36
+
-- the renamed column. A no-op assignment is not enough here because SQL Server
37
+
-- may skip writing CDC rows when the value does not change.
38
+
UPDATEdbo.products
39
+
SET add_column = add_column +1000
40
+
WHERE id IN (101, 103, 104, 105, 106, 107, 108, 109, 110, 120, 121, 128, 129, 130, 131, 140, 141);
41
+
42
+
UPDATEdbo.products
43
+
SET add_column = add_column -1000
44
+
WHERE id IN (101, 103, 104, 105, 106, 107, 108, 109, 110, 120, 121, 128, 129, 130, 131, 140, 141);
0 commit comments