westonpace commented on code in PR #6321:
URL: https://github.com/apache/arrow-rs/pull/6321#discussion_r1735246052


##########
arrow-ipc/src/writer.rs:
##########
@@ -1221,49 +1258,56 @@ pub struct EncodedData {
 }
 /// Write a message's IPC data and buffers, returning metadata and buffer data 
lengths written
 pub fn write_message<W: Write>(
+    writer: W,
+    encoded: EncodedData,
+    write_options: &IpcWriteOptions,
+) -> Result<(usize, usize), ArrowError> {
+    write_message_at_offset(writer, 0, encoded, write_options)
+}
+
+fn write_message_at_offset<W: Write>(

Review Comment:
   Minor nit: this function name confuses me slightly.  If I'm writing to a 
"file-like object' (e.g. `Write`) then there is no underlying capability to 
write at an offset.  "Skip offset bytes" doesn't make sense in a write context 
(as opposed to a read context).
   
   I think...instead...you are maybe using the `offset` to determine how much 
padding to add at the end?
   
   Maybe `write_remaining_message` with `offset` replaced by `already_written`?



##########
arrow-ipc/src/writer.rs:
##########
@@ -824,12 +824,12 @@ impl DictionaryTracker {
 pub struct FileWriter<W> {
     /// The object to write to
     writer: W,
+    /// The number of bytes written
+    written_len: usize,
     /// IPC write options
     write_options: IpcWriteOptions,
     /// A reference to the schema, used in validating record batches
     schema: SchemaRef,
-    /// The number of bytes between each block of bytes, as an offset for 
random access
-    block_offsets: usize,

Review Comment:
   I don't really understand what this was doing so I'm not sure I understand 
what it means that it is going away.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to