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


##########
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:
   Fixed, hive doesn't support trim characters within the range 0x7F to 0x9F, 
but it would be a reasonable improvement.
   ```sql
   hive> select date("2023-06-08\u0003");
   OK
   2023-06-08
   Time taken: 0.673 seconds, Fetched: 1 row(s)
   hive> select date("2023-06-08\u007F");
   OK
   NULL
   Time taken: 0.735 seconds, Fetched: 1 row(s)
   hive> select date("2023-06-08\u0020");
   OK
   2023-06-08
   Time taken: 0.735 seconds, Fetched: 1 row(s)
   hive> 
   ```
   



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