You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Chenzhao Guo (JIRA)" <ji...@apache.org> on 2017/07/14 03:20:00 UTC

[jira] [Created] (SPARK-21412) Reset BufferHolder while initialize an UnsafeRowWriter

Chenzhao Guo created SPARK-21412:
------------------------------------

             Summary: Reset BufferHolder while initialize an UnsafeRowWriter
                 Key: SPARK-21412
                 URL: https://issues.apache.org/jira/browse/SPARK-21412
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 2.1.1
            Reporter: Chenzhao Guo


UnsafeRowWriter's construtor should contain BufferHolder.reset to make the writer out of the box.

While writing UnsafeRow using UnsafeRowWriter, developers should manually call BufferHolder.reset to make the BufferHolder's cursor(which indicates where to write variable length portion) right in order to write variable length fields like UTF8String, byte[], etc.

If a developer doesn't reuse the BufferHolder so maybe he never noticed reset and the comments in code, the UnsafeRow won't be correct if he also writes variable length UTF8String. This API design doesn't make sense. We should reset the BufferHolder to make UnsafeRowWriter out of the box, but not let user read the code and manually call it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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