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

    https://github.com/apache/spark/pull/19222#discussion_r175605220
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java ---
    @@ -119,15 +115,24 @@ public static UTF8String blankString(int length) {
         return fromBytes(spaces);
       }
     
    -  protected UTF8String(Object base, long offset, int numBytes) {
    +  protected UTF8String(byte[] bytes, long offset, int numBytes) {
    +    this(new ByteArrayMemoryBlock(bytes, offset, numBytes));
    +  }
    +
    +  public UTF8String(MemoryBlock base) {
         this.base = base;
    -    this.offset = offset;
    -    this.numBytes = numBytes;
    +    if (base != null) {
    --- End diff --
    
    I think we can actually add ab assert to make sure `base` is not null.


---

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

Reply via email to