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>` to avoid creating message everytime.



-- 
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-unsubscr...@paimon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to