You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Kwafoor (via GitHub)" <gi...@apache.org> on 2023/06/09 10:23:44 UTC

[GitHub] [spark] Kwafoor commented on a diff in pull request #41535: [SPARK-32559]Fix the trim logic did't handle ASCII control characters correctly

Kwafoor commented on code in PR #41535:
URL: https://github.com/apache/spark/pull/41535#discussion_r1224133517


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

Review Comment:
   You're right, I'll make some adjustments and test the behavior in Hive to see how it performs.



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