SteNicholas commented on code in PR #302:
URL: https://github.com/apache/flink-table-store/pull/302#discussion_r977219669
##########
flink-table-store-core/src/test/java/org/apache/flink/table/store/table/SchemaEvolutionTest.java:
##########
@@ -120,6 +122,28 @@ public void testAddField() throws Exception {
assertThat(rows).containsExactlyInAnyOrder(Row.of(3, 3L, 3L),
Row.of(4, 4L, 4L));
}
+ @Test
+ public void testAddDuplicateField() throws Exception {
+ UpdateSchema updateSchema =
+ new UpdateSchema(
+ RowType.of(new IntType(), new BigIntType()),
+ Collections.emptyList(),
+ Collections.emptyList(),
+ new HashMap<>(),
+ "");
+ schemaManager.commitNewVersion(updateSchema);
+ schemaManager.commitChanges(
+ Collections.singletonList(SchemaChange.addColumn("f3", new
BigIntType())));
+ assertThatThrownBy(
+ () -> {
+ schemaManager.commitChanges(
+ Collections.singletonList(
+ SchemaChange.addColumn("f3", new
FloatType())));
+ })
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessageStartingWith("The column[f3] is exist in");
Review Comment:
Why not use `hasMessage` to verify the complete exception message?
--
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]