[ 
https://issues.apache.org/jira/browse/ARROW-1860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16337899#comment-16337899
 ] 

Wes McKinney commented on ARROW-1860:
-------------------------------------

I'm running into a slight issue with this refactoring around output streams 
which are currently at a position that is not a multiple of 8. 

see 
https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/metadata-internal.cc#L903

This results in the entire message payload being non-deterministic depending on 
the state of the OutputStream. I don't think it will impact any applications, 
but I suggest we write padding bytes at the _start_ to an 8-byte offset and 
then begin writing the message. This is the same approach used by 
{{WriteTensor}} in 
https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/writer.cc#L621. 

[~robertnishihara] [~pcmoritz] [~xhochy] does this seem reasonable?

> [C++] Add data structure to "stage" a sequence of IPC messages from in-memory 
> data
> ----------------------------------------------------------------------------------
>
>                 Key: ARROW-1860
>                 URL: https://issues.apache.org/jira/browse/ARROW-1860
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>             Fix For: 0.9.0
>
>         Attachments: text.html
>
>
> Currently, when you need to pre-allocate space for a record batch or a stream 
> (schema + dictionaries + record batches), you must make multiple passes over 
> the data structures of interest (and use e.g. {{MockOutputStream}} to compute 
> the size of the output buffer). It would be useful to make a single pass to 
> "prepare" the IPC payload for both sizing and writing to prevent having to 
> make multiple passes



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to