You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "uros-db (via GitHub)" <gi...@apache.org> on 2024/08/16 09:20:21 UTC

Re: [PR] [SPARK-48682][SQL][FOLLOW-UP] Changed initCap behaviour with UTF8_BINARY collation [spark]

uros-db commented on code in PR #47771:
URL: https://github.com/apache/spark/pull/47771#discussion_r1719589019


##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationAwareUTF8String.java:
##########
@@ -1267,6 +1272,129 @@ public static UTF8String[] icuSplitSQL(final UTF8String string, final UTF8String
     return strings.toArray(new UTF8String[0]);
   }
 
+  /**
+   * Title casing a string according to a new behaviour. Iterates over the string and title cases
+   * the first character in each word, and lowercases every other character. Handles lowercasing
+   * capital Greek letter sigma ('Σ') separately, taking into account if it should be a small final
+   * Greek sigma ('ς') or small non-final Greek sigma ('σ'). Words are separated by ASCII
+   * space(\u0020).
+   *
+   * @param target UTF8String to be title cased
+   * @return title cased target
+   */
+  public static UTF8String toTitleCaseICU(UTF8String target) {

Review Comment:
   iiuc, we already have two `public static UTF8String toTitleCase` methods in this file
   
   so let's move the new code a bit higher up in the `CollationAwareUTF8String` file (instead of appending it at the end)



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