Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9030#discussion_r41553070
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
 ---
    @@ -596,4 +601,40 @@ public boolean anyNull() {
       public void writeToMemory(Object target, long targetOffset) {
         Platform.copyMemory(baseObject, baseOffset, target, targetOffset, 
sizeInBytes);
       }
    +
    +  @Override
    +  public void writeExternal(ObjectOutput out) throws IOException {
    +    byte[] bytes = getBytes();
    +    out.writeInt(bytes.length);
    +    out.writeInt(this.numFields);
    +    out.write(bytes);
    +  }
    +
    +  @Override
    +  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
    +    this.baseOffset = BYTE_ARRAY_OFFSET;
    +    this.sizeInBytes = in.readInt();
    +    this.numFields = in.readInt();
    +    this.bitSetWidthInBytes = calculateBitSetWidthInBytes(numFields);
    +    this.baseObject = new byte[sizeInBytes];
    +    in.readFully((byte[]) baseObject);
    +  }
    +
    +  @Override
    +  public void write(Kryo kryo, Output out) {
    +    byte[] bytes = getBytes();
    +    out.writeInt(bytes.length);
    +    out.writeInt(this.numFields);
    +    out.write(bytes);
    --- End diff --
    
    can this just call `writeExternal(out)`?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to