Skip to content

Commit

Permalink
assert zero body is written for schema messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz committed Sep 27, 2024
1 parent 95b6975 commit 70c88e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arrow-ipc/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,10 @@ impl<W: Write> FileWriter<W> {
// write the schema
let encoded_message = data_gen.schema_to_bytes(schema, &write_options);

let (meta, _data) =
let (meta, data) =
write_message(&mut writer, written_len, encoded_message, &write_options)?;
// The schema message has no body
debug_assert_eq!(data, 0);

// written bytes = padded_magic + schema
written_len += meta;
Expand Down

0 comments on commit 70c88e8

Please sign in to comment.