dongjoon-hyun commented on code in PR #46147:
URL: https://github.com/apache/spark/pull/46147#discussion_r1575051874
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -206,7 +210,7 @@ public static StringSearch getStringSearch(
* Returns if the given collationName is valid one.
*/
public static boolean isValidCollation(String collationName) {
- return collationNameToIdMap.containsKey(collationName.toUpperCase());
+ return
collationNameToIdMap.containsKey(collationName.toUpperCase(Locale.ROOT));
Review Comment:
Just a question. Is this safe?
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -215,7 +219,7 @@ public static boolean isValidCollation(String
collationName) {
public static String getClosestCollation(String collationName) {
Collation suggestion = Collections.min(List.of(collationTable),
Comparator.comparingInt(
c -> UTF8String.fromString(c.collationName).levenshteinDistance(
- UTF8String.fromString(collationName.toUpperCase()))));
+
UTF8String.fromString(collationName.toUpperCase(Locale.ROOT)))));
Review Comment:
ditto.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]