spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevinyu98 <...@git.apache.org>
Subject [GitHub] spark pull request #12646: [SPARK-14878][SQL] Trim characters string functio...
Date Mon, 22 May 2017 23:25:42 GMT
Github user kevinyu98 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12646#discussion_r117867452
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java ---
    @@ -510,6 +510,69 @@ public UTF8String trim() {
         }
       }
     
    +  /**
    +   * Removes the given trim string from both ends of a string
    +   * @param trimString the trim character string
    +   */
    +  public UTF8String trim(UTF8String trimString) {
    +    // This method searches for each character in the source string, removes the character
if it is found
    +    // in the trim string, stops at the first not found. It starts from left end, then
right end.
    +    // It returns a new string in which both ends trim characters have been removed.
    +    int s = 0; // the searching byte position of the input string
    +    int i = 0; // the first beginning byte position of a non-matching character
    +    int e = 0; // the last byte position
    +    int numChars = 0; // number of characters from the input string
    +    int[] stringCharLen = new int[numBytes]; // array of character length for the input
string
    +    int[] stringCharPos = new int[numBytes]; // array of the first byte position for
each character in the input string
    +    int searchCharBytes;
    +
    --- End diff --
    
    will add this comment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message