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 2020/08/06 09:19:27 UTC
[GitHub] [spark] yaooqinn commented on a change in pull request #29375: [SPARK-32559][SQL]Fix the trim logic in UTF8String.toInt/toLong did't handle Chinese characters correctly
yaooqinn commented on a change in pull request #29375:
URL: https://github.com/apache/spark/pull/29375#discussion_r466267358
##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -575,14 +575,14 @@ public UTF8String trim() {
public UTF8String trimAll() {
int s = 0;
// skip all of the whitespaces (<=0x20) in the left side
- while (s < this.numBytes && getByte(s) <= ' ') s++;
+ while (s < this.numBytes && canBeTrimmed(getByte(s))) s++;
Review comment:
Does`java.lang.Character.isWhitespace(char)` work as well?
----------------------------------------------------------------
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.
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