Skip to content

Commit 45ac503

Browse files
committed
fix comments
Signed-off-by: Pei Yu <125331682@qq.com>
1 parent 6825ec1 commit 45ac503

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ private static Schema applyAddColumnEvent(AddColumnEvent event, Schema oldSchema
144144
if (index < 0) {
145145
throw new IllegalArgumentException(
146146
String.format(
147-
"BEFORE type AddColumnEvent error: Table %s's column %s is not existed",
148-
event.tableId(),
149-
columnWithPosition.getExistedColumnName()));
147+
"BEFORE type AddColumnEvent error: Column %s does not exist in table %s",
148+
columnWithPosition.getExistedColumnName(),
149+
event.tableId()));
150150
}
151151
columns.add(index, columnWithPosition.getAddColumn());
152152
break;
@@ -162,9 +162,9 @@ private static Schema applyAddColumnEvent(AddColumnEvent event, Schema oldSchema
162162
if (index < 0) {
163163
throw new IllegalArgumentException(
164164
String.format(
165-
"AFTER type AddColumnEvent error: Table %s's column %s is not existed",
166-
event.tableId(),
167-
columnWithPosition.getExistedColumnName()));
165+
"AFTER type AddColumnEvent error: Column %s does not exist in table %s",
166+
columnWithPosition.getExistedColumnName(),
167+
event.tableId()));
168168
}
169169
columns.add(index + 1, columnWithPosition.getAddColumn());
170170
break;

flink-cdc-common/src/test/java/org/apache/flink/cdc/common/utils/SchemaUtilsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ void testApplyColumnSchemaChangeEvent() {
138138
.isExactlyInstanceOf(IllegalArgumentException.class)
139139
.hasMessage(
140140
String.format(
141-
"BEFORE type AddColumnEvent error: Table %s's column %s is not existed",
142-
tableId, "col10"));
141+
"BEFORE type AddColumnEvent error: Column %s does not exist in table %s",
142+
"col10", tableId));
143143

144144
// wrong add column in after type
145145
Assertions.assertThatThrownBy(
@@ -157,8 +157,8 @@ void testApplyColumnSchemaChangeEvent() {
157157
.isExactlyInstanceOf(IllegalArgumentException.class)
158158
.hasMessage(
159159
String.format(
160-
"AFTER type AddColumnEvent error: Table %s's column %s is not existed",
161-
tableId, "col10"));
160+
"AFTER type AddColumnEvent error: Column %s does not exist in table %s",
161+
"col10", tableId));
162162

163163
// drop columns
164164
DropColumnEvent dropColumnEvent =

0 commit comments

Comments
 (0)