JingsongLi commented on code in PR #9771:
URL: https://github.com/apache/paimon/pull/9771#discussion_r4001782573
##########
paimon-api/src/main/java/org/apache/paimon/utils/StringUtils.java:
##########
@@ -668,7 +669,9 @@ public static String quote(String str) {
}
public static String toLowerCaseIfNeed(String str, boolean caseSensitive) {
- return caseSensitive ? str : str.toLowerCase();
+ // Locale.ROOT: identifier matching must not depend on the JVM default
locale
+ // (e.g. Turkish lowercases 'I' to a dotless glyph and breaks column
mapping)
+ return caseSensitive ? str : str.toLowerCase(Locale.ROOT);
Review Comment:
[P1] Normalize CDC key lists with the same locale as fields
buildPaimonSchema uses this helper for field names, but
CdcActionCommonUtils.listCaseConvert still maps String::toLowerCase for
source/configured primary keys and partition keys. With Locale tr-TR and a
case-insensitive catalog, a fresh source column ID with primary key ID now
becomes field id and key ıd, and Schema rejects the table. In the non-strict
database-sync path, fields id/CITY with configured partition CITY instead
become fields [id, city] and partitionKeys=[], silently dropping the requested
partitioning.
I compiled the exact helper and CDC schema builder and exercised both paths:
this head fails/drops the partition as above; the exact-base helper
consistently produces [ıd]/[ıd] and [id, cıty]/[cıty]. JDBC metadata supplies
source column/key names without an earlier normalization, so these inputs are
reachable. Please convert listCaseConvert with the same explicit locale and add
Turkish schema tests for inferred/configured keys and non-strict partition
handling. The audit must include method references such as String::toLowerCase,
which a search for .toLowerCase() misses.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]