You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2023/05/10 13:52:37 UTC
[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1123: [flink][refactor] Extract caseSensitive related codes from MySqlSchema to util
JingsongLi commented on code in PR #1123:
URL: https://github.com/apache/incubator-paimon/pull/1123#discussion_r1189946898
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncDatabaseAction.java:
##########
@@ -288,37 +289,32 @@ private boolean shouldMonitorTable(String mySqlTableName) {
return shouldMonitor;
}
- private boolean shouldMonitorTable(
- TableSchema tableSchema, MySqlSchema mySqlSchema, Identifier identifier) {
+ private boolean shouldMonitorTable(TableSchema tableSchema, Schema mySqlSchema, String errMsg) {
if (MySqlActionUtils.schemaCompatible(tableSchema, mySqlSchema)) {
return true;
} else if (ignoreIncompatible) {
- LOG.warn(
- "Incompatible schema found. This table will be ignored.\n"
- + "Paimon table is: {}, fields are: {}.\n"
- + "MySQL table is: {}.{}, fields are: {}.",
- identifier.getFullName(),
- tableSchema.fields(),
- mySqlSchema.databaseName(),
- mySqlSchema.tableName(),
- mySqlSchema.fields());
+ LOG.warn(errMsg + "This table will be ignored.");
return false;
} else {
throw new IllegalArgumentException(
- String.format(
- "Incompatible schema found.\n"
- + "Paimon table is: %s, fields are: %s.\n"
- + "MySQL table is: %s.%s, fields are: %s.\n"
- + "If you want to ignore the incompatible tables, "
- + "please specify --ignore-incompatible to true.",
- identifier.getFullName(),
- tableSchema.fields(),
- mySqlSchema.databaseName(),
- mySqlSchema.tableName(),
- mySqlSchema.fields()));
+ errMsg
+ + "If you want to ignore the incompatible tables, please specify --ignore-incompatible to true.");
}
}
+ private String incompatibleMessage(
Review Comment:
return a `Supplier<String>`
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org