yuxiqian commented on code in PR #3448:
URL: https://github.com/apache/flink-cdc/pull/3448#discussion_r1675329046
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/test/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssignerTest.java:
##########
@@ -416,6 +416,28 @@ public void testTableWithoutPrimaryKey() {
}
}
+ @Test
+ public void testAssignTableWithoutPrimaryKeyWithChunkKeyColumn() {
+ String tableWithoutPrimaryKey = "customers_no_pk";
+ List<String> expected =
+ Arrays.asList(
+ "customers_no_pk null [462]",
+ "customers_no_pk [462] [823]",
+ "customers_no_pk [823] [1184]",
+ "customers_no_pk [1184] [1545]",
+ "customers_no_pk [1545] [1906]",
+ "customers_no_pk [1906] null");
+ List<String> splits =
+ getTestAssignSnapshotSplits(
+ customerDatabase,
+ 4,
+
CHUNK_KEY_EVEN_DISTRIBUTION_FACTOR_UPPER_BOUND.defaultValue(),
+
CHUNK_KEY_EVEN_DISTRIBUTION_FACTOR_LOWER_BOUND.defaultValue(),
+ new String[] {tableWithoutPrimaryKey},
+ "id");
+ assertEquals(expected, splits);
+ }
Review Comment:
It would be nice if we can also test using non-primary key columns as chunk
keys for table with primary keys.
--
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]