You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "zhuangchong (via GitHub)" <gi...@apache.org> on 2023/04/21 10:30:02 UTC

[GitHub] [incubator-paimon] zhuangchong commented on a diff in pull request #977: [hotfix] improve error message when constructing MySqlSchema

zhuangchong commented on code in PR #977:
URL: https://github.com/apache/incubator-paimon/pull/977#discussion_r1173612067


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSchema.java:
##########
@@ -63,10 +66,15 @@ public MySqlSchema(
                     scale = null;
                 }
                 if (!caseSensitive) {
+                    if (fields.containsKey(fieldName.toLowerCase())) {
+                        LOG.warn(
+                                "Duplicate key '{}' appears in table '{}.{}' when converting fields map keys "
+                                        + "to case-insensitive form. This may cause error.",
+                                fieldName,
+                                databaseName,
+                                originalTableName);
+                    }
                     fieldName = fieldName.toLowerCase();

Review Comment:
   
   ```Java
   fieldName = fieldName.toLowerCase();
   if (fields.containsKey(fieldName)) {
                        ...
   }
   ``` 



-- 
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