You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/03/22 20:05:37 UTC

[GitHub] [arrow-nanoarrow] paleolimbot commented on a diff in pull request #164: feat(extensions/nanoarrow_ipc): Add single-threaded stream reader

paleolimbot commented on code in PR #164:
URL: https://github.com/apache/arrow-nanoarrow/pull/164#discussion_r1145350451


##########
extensions/nanoarrow_ipc/src/nanoarrow/nanoarrow_ipc.h:
##########
@@ -219,6 +227,60 @@ ArrowErrorCode ArrowIpcDecoderDecodeArray(struct ArrowIpcDecoder* decoder,
                                           struct ArrowArray* out,
                                           struct ArrowError* error);
 
+/// \brief An user-extensible input data source
+struct ArrowIpcInputStream {
+  /// \brief Read up to buf_size_bytes from stream into buf
+  ///
+  /// The actual number of bytes read is placed in the value pointed to by
+  /// size_read_out. Returns NANOARROW_OK on success.
+  ArrowErrorCode (*read)(struct ArrowIpcInputStream* stream, void* buf,

Review Comment:
   > Perhaps consider a concrete type (char*, uint8_t*) for buf
   
   Totally!
   
   > What do you think about char** buf (i.e., letting the stream do the allocation)?
   
   I played with changing it to `struct ArrowBuffer*` but it's complicated...probably the way to go about that would be to do what Arrow C++ does and make it a separate method (I think Arrow's is called `ReadAt()` or something? If somebody really wants slicing of an in-memory buffer they can use the `ArrowIpcDecoder` directly too.



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

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