dssysolyatin commented on code in PR #4028:
URL: https://github.com/apache/calcite/pull/4028#discussion_r1826247379


##########
core/src/main/java/org/apache/calcite/util/NlsString.java:
##########
@@ -227,6 +227,27 @@ public NlsString rtrim() {
     return this;
   }
 
+  /**
+   * Returns a string the same as this but with spaces trimmed from the
+   * right such that the result has the specified size.
+   *
+   * @param resultSize Expected size for result string.  If negative, it 
indicates
+   *                   that no trimming should be done.
+   */
+  public NlsString rtrim(int resultSize) {

Review Comment:
   @mihaibudiu The implementation is a bit confusing: For example:
   ```
   NlsString string = new NlsString("hello world ", null, null);
   string.rtrim(5);
   ```
   produces "helloworld". It removes spaces from the middle, even though the 
documentation claims it should remove them only from the right.
   
   Also, what should happen if the string cannot be reduced to the specified 
resultSize?



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

Reply via email to