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


##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationAwareUTF8String.java:
##########
@@ -1260,7 +1364,32 @@ public static UTF8String lowercaseTrimRight(
 
     // Iterate over `srcString` from the right to find the first character 
that is not in the set.
     int searchIndex = srcString.numChars(), codePoint, codePointBuffer = -1;
+
+    // In cases of trim collation (rtrim for example) trailing spaces should 
be ignored.
+    // If trimString contains spaces this behaviour is not important as they 
would get trimmed
+    // anyway. However, if it is not the case they should be ignored and then 
appended after
+    // trimming other characters.
+    int lastNonSpaceByteIdx = srcString.numBytes(), lastNonSpaceCharacterIdx = 
srcString.numChars();
+    if  (!trimChars.contains(0x20) &&

Review Comment:
   ```suggestion
       if (!trimChars.contains(0x20) &&
   ```



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

Reply via email to