You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2024/04/23 02:57:56 UTC
Re: [PR] [SPARK-47936][BUILD] Improve `toUpperCase` & `toLowerCase` with `Locale.ROOT` rules [spark]
LuciferYang commented on code in PR #46147:
URL: https://github.com/apache/spark/pull/46147#discussion_r1575579520
##########
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:
`toUpperCase(Locale.ROOT)` uses the root language environment, which is independent of the default language environment of the machine, ensuring consistent results across different machines, I think it's ok.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org