cloud-fan commented on a change in pull request #31253:
URL: https://github.com/apache/spark/pull/31253#discussion_r560788460



##########
File path: 
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -683,6 +683,16 @@ public UTF8String trimRight() {
     return copyUTF8String(0, e);
   }
 
+  /**
+   * Return the length of string stripped at most `numOfSpaces` tailing spaces
+   */
+  public int effectiveLength(int numOfSpaces) {

Review comment:
       how about `public UTF8String trimTrailingSpaces(int numSpaces)`? I don't 
think we need to save the string creating for the error case, as perf doesn't 
matter much for that case.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to