lidavidm commented on a change in pull request #11535:
URL: https://github.com/apache/arrow/pull/11535#discussion_r741904720
##########
File path: cpp/src/arrow/ipc/message.cc
##########
@@ -290,7 +291,8 @@ Result<std::unique_ptr<Message>> ReadMessage(int64_t
offset, int32_t metadata_le
decoder.next_required_size());
}
- ARROW_ASSIGN_OR_RAISE(auto metadata, file->ReadAt(offset, metadata_length));
+ int64_t to_read = body_length > 0 ? (metadata_length + body_length) :
metadata_length;
Review comment:
Hmm. So normally the body_length comes from
CheckMetadataAndGetBodyLength which just gets the bodyLength from the Message
flatbuffer. The body_length here comes from the FileBlock in the footer, which
according to File.fbs should be aligned already. And in writer.cc it looks like
we add the padding to the metadata length, so body_length should be OK:
https://github.com/apache/arrow/blob/16af17c3327cfe624038913a7a808656082f69e0/cpp/src/arrow/ipc/writer.cc#L1234-L1236
--
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]