From 70c88e83227384756ad19ca5159f1d402feb297b Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 27 Sep 2024 13:25:16 -0700 Subject: [PATCH] assert zero body is written for schema messages --- arrow-ipc/src/writer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arrow-ipc/src/writer.rs b/arrow-ipc/src/writer.rs index 4b0f4a00b513..09e9da8c92ee 100644 --- a/arrow-ipc/src/writer.rs +++ b/arrow-ipc/src/writer.rs @@ -892,8 +892,10 @@ impl FileWriter { // 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;