You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/11 16:59:42 UTC

[GitHub] [spark] srowen commented on a change in pull request #33287: [SPARK-36081][SPARK-36066][SQL] Fix the compatibility breaking issue related to cast and UTF8String

srowen commented on a change in pull request #33287:
URL: https://github.com/apache/spark/pull/33287#discussion_r667508922



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -574,14 +574,14 @@ public UTF8String trim() {
   public UTF8String trimAll() {
     int s = 0;
     // skip all of the whitespaces (<=0x20) in the left side
-    while (s < this.numBytes && Character.isWhitespace(getByte(s))) s++;
+    while (s < this.numBytes && getByte(s) <= 0x20) s++;

Review comment:
       Looking at https://github.com/apache/spark/pull/29375 , it seems like the change was at least partly on purpose to catch 'whitespace' that isn't ASCII 32 or less. @WangGuangxin is this change of behavior necessary? Do we need to check for `.isWhitespace` _or_ `<= 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: 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