Skip to content

Commit

Permalink
ADD: added testAssignTableWithPrimaryKeyWithChunkKeyColumnNotInPrimar…
Browse files Browse the repository at this point in the history
…yKey
  • Loading branch information
Seung-Min Lee committed Jul 14, 2024
1 parent 8d5fb00 commit f42f809
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,27 @@ public void testAssignTableWithoutPrimaryKeyWithChunkKeyColumn() {
assertEquals(expected, splits);
}

public void testAssignTableWithPrimaryKeyWithChunkKeyColumnNotInPrimaryKey() {
String tableWithoutPrimaryKey = "customers";
List<String> expected =
Arrays.asList(
"customers_no_pk null [user_5]",
"customers_no_pk [user_5] [user_9]",
"customers_no_pk [user_9] [user_13]",
"customers_no_pk [user_13] [user_17]",
"customers_no_pk [user_17] [user_20]",
"customers_no_pk [user_20] 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},
"name");
assertEquals(expected, splits);
}

@Test
public void testEnumerateTablesLazily() {
final MySqlSourceConfig configuration =
Expand Down

0 comments on commit f42f809

Please sign in to comment.