Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19222#discussion_r177686923
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java ---
    @@ -119,15 +118,16 @@ public static UTF8String blankString(int length) {
         return fromBytes(spaces);
       }
     
    -  protected UTF8String(Object base, long offset, int numBytes) {
    +  public UTF8String(MemoryBlock base) {
         this.base = base;
    -    this.offset = offset;
    -    this.numBytes = numBytes;
    +    if (base != null) {
    +      this.numBytes = Ints.checkedCast(base.size());
    +    }
       }
     
       // for serialization
       public UTF8String() {
    -    this(null, 0, 0);
    +    this(null);
    --- End diff --
    
    if this is the only place to pass in a null MemoryBlock, we can probably do 
nothing here instead of calling `this(null)`.


---

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

Reply via email to