SteNicholas commented on code in PR #302:
URL: https://github.com/apache/flink-table-store/pull/302#discussion_r977218529
##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/schema/SchemaManager.java:
##########
@@ -173,6 +174,15 @@ public TableSchema commitChanges(List<SchemaChange>
changes) throws Exception {
newOptions.remove(removeOption.key());
} else if (change instanceof AddColumn) {
AddColumn addColumn = (AddColumn) change;
+ Set<String> fieldNames =
+
newFields.stream().map(DataField::name).collect(Collectors.toSet());
+ if (fieldNames.contains(addColumn.fieldName())) {
+ throw new IllegalArgumentException(
+ "The column["
Review Comment:
```suggestion
String.format("The column [%s] exists in the
table[%s].".format(addColumn.fieldName(), tableRoot))
```
--
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]