Skip to content

Commit 9842c50

Browse files
remove Catalog.ColumnAlreadyExistException when apply applyAddColumnEventWithPosition in paimon. because use may create table already before with the target column.
1 parent f91f167 commit 9842c50

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/main/java/org/apache/flink/cdc/connectors/paimon/sink/PaimonMetadataApplier.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ private void applyAddColumn(AddColumnEvent event) throws SchemaEvolveException {
201201
} catch (Catalog.TableNotExistException
202202
| Catalog.ColumnAlreadyExistException
203203
| Catalog.ColumnNotExistException e) {
204-
throw new SchemaEvolveException(event, e.getMessage(), e);
204+
if (e instanceof Catalog.ColumnAlreadyExistException) {
205+
LOG.warn("{}, skip it.", e.getMessage());
206+
} else {
207+
throw new SchemaEvolveException(event, e.getMessage(), e);
208+
}
205209
}
206210
}
207211

@@ -293,11 +297,7 @@ private void applyDropColumn(DropColumnEvent event) throws SchemaEvolveException
293297
} catch (Catalog.TableNotExistException
294298
| Catalog.ColumnAlreadyExistException
295299
| Catalog.ColumnNotExistException e) {
296-
if (e instanceof Catalog.ColumnAlreadyExistException) {
297-
LOG.warn("{}, skip it.", e.getMessage());
298-
} else {
299-
throw new SchemaEvolveException(event, e.getMessage(), e);
300-
}
300+
throw new SchemaEvolveException(event, e.getMessage(), e);
301301
}
302302
}
303303

0 commit comments

Comments
 (0)