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

    https://github.com/apache/spark/pull/7885#discussion_r36057330
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
 ---
    @@ -442,6 +442,24 @@ public UnsafeRow copy() {
       }
     
       /**
    +   * Copies this row, returning a UnsafeRow that stores its data to a 
user-provided byte[] buffer.
    +   * User should ensure that provided buffer is large enough to store this 
row.
    +   */
    +  public UnsafeRow copyTo(byte[] buffer) {
    --- End diff --
    
    i was thinking about this ... have:
    
    a static method fromByteArray(numBytes: Int) that is a factory method
    
    and then add a 
    
    copyFrom(UnsafeRow other)
    
    which basically copies the data from other into the current buffer.
    
    If the size is too small, change the buffer to expand it. 
    
    Then it is easy to use. Just call copyFrom where we call copy right now.



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