Copilot commented on code in PR #4353:
URL: https://github.com/apache/flink-cdc/pull/4353#discussion_r3004523547
##########
flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaUtils.java:
##########
@@ -159,8 +161,10 @@ private static Schema applyAddColumnEvent(AddColumnEvent
event, Schema oldSchema
int index =
columnNames.indexOf(columnWithPosition.getExistedColumnName());
if (index < 0) {
throw new IllegalArgumentException(
- columnWithPosition.getExistedColumnName()
- + " of AddColumnEvent is not
existed");
+ String.format(
+ "AFTER type AddColumnEvent error:
Table %s's column %s is not existed",
+ event.tableId(),
+
columnWithPosition.getExistedColumnName()));
Review Comment:
Same as the BEFORE branch: the error message uses ungrammatical wording ("is
not existed") and awkward possessive formatting. Please rephrase (e.g., "Column
%s does not exist in table %s") and consider deriving the position string from
the enum to avoid duplicated message templates.
##########
flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaUtils.java:
##########
@@ -143,8 +143,10 @@ private static Schema applyAddColumnEvent(AddColumnEvent
event, Schema oldSchema
int index =
columnNames.indexOf(columnWithPosition.getExistedColumnName());
if (index < 0) {
throw new IllegalArgumentException(
- columnWithPosition.getExistedColumnName()
- + " of AddColumnEvent is not
existed");
+ String.format(
+ "BEFORE type AddColumnEvent error:
Table %s's column %s is not existed",
+ event.tableId(),
+
columnWithPosition.getExistedColumnName()));
Review Comment:
The new IllegalArgumentException message is grammatically incorrect ("is not
existed") and the possessive "Table %s's" reads awkwardly (and becomes wrong
for table names ending with 's'). Consider rephrasing to something like "Column
%s does not exist in table %s" (and optionally include position=%s) to keep the
improved context but make it clearer.
--
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]