Copilot commented on code in PR #4377:
URL: https://github.com/apache/flink-cdc/pull/4377#discussion_r3084530882


##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-maxcompute/src/test/java/org/apache/flink/cdc/connectors/maxcompute/utils/SchemaEvolutionUtilsTest.java:
##########
@@ -128,4 +128,25 @@ void testRenameColumn() {
             fail(e.getMessage());
         }
     }
+
+    @Test
+    void testCreateTableInAppendMode() {
+        try {
+            String appendTable = "SCHEMA_EVOLUTION_APPEND_TABLE";
+            SchemaEvolutionUtils.createTable(
+                    appendOptions,
+                    TableId.tableId(appendTable),
+                    Schema.newBuilder()
+                            .physicalColumn("PK", DataTypes.BIGINT())
+                            .physicalColumn("ID1", DataTypes.BIGINT())
+                            .primaryKey("PK")
+                            .build());
+            // In APPEND mode the table should NOT be created as a 
transactional table,
+            // so primary key metadata should be absent even though the schema 
defines one.
+            
assertThat(odpsInstance.tables().get(appendTable).getPrimaryKey()).isEmpty();
+            odpsInstance.tables().delete(appendTable, true);

Review Comment:
   `appendTable` is only deleted on the happy path; if an assertion fails 
(AssertionError) the cleanup won’t run and the emulator state may leak across 
tests. Prefer deleting the table in a `finally` block (or an `@AfterEach` 
cleanup) so it’s always removed even when the test fails.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to