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


##########
arrow-ipc/src/writer.rs:
##########
@@ -879,20 +879,31 @@ impl<W: Write> FileWriter<W> {
         write_options: IpcWriteOptions,
     ) -> Result<Self, ArrowError> {
         let data_gen = IpcDataGenerator::default();
-        // write magic to header aligned on alignment boundary
-        let pad_len = pad_to_alignment(write_options.alignment, 
super::ARROW_MAGIC.len());
-        let header_size = super::ARROW_MAGIC.len() + pad_len;
+
+        let mut written_len = 0;
+
+        // write magic and padding
         writer.write_all(&super::ARROW_MAGIC)?;
+        written_len += super::ARROW_MAGIC.len();
+        let pad_len = pad_to_alignment(8, written_len);
         writer.write_all(&PADDING[..pad_len])?;
-        // write the schema, set the written bytes to the schema + header
+        written_len += pad_len;
+
+        // write the schema
         let encoded_message = data_gen.schema_to_bytes(schema, &write_options);
-        let (meta, data) = write_message(&mut writer, encoded_message, 
&write_options)?;
+
+        let (meta, _data) =
+            write_message(&mut writer, written_len, encoded_message, 
&write_options)?;

Review Comment:
   alright



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