You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/25 15:32:12 UTC

[GitHub] [arrow] joeyac commented on issue #9311: [arrow c++] How can I modify `RecordBatch` or `Table` value piped from another c++ program?

joeyac commented on issue #9311:
URL: https://github.com/apache/arrow/issues/9311#issuecomment-766898581


   finally, I found the related source code:
   https://github.com/apache/arrow/blob/master/cpp/src/arrow/io/memory.cc#L351
   before this line, `buffer_` from `StdinStream` is mutable, but `buffer` sliced by `SliceBuffer` returns an immutable `buffer` by default.
   I replace
   ```cpp
   return SliceBuffer(buffer_, position, nbytes);
   ```
   with
   ```cpp
   if (buffer_->is_mutable()) return SliceMutableBuffer(buffer_, position, nbytes);
   else return SliceBuffer(buffer_, position, nbytes);
   ```
   then I can modify data with mutable data ptr.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org