liyafan82 commented on a change in pull request #7326: URL: https://github.com/apache/arrow/pull/7326#discussion_r465618946
########## File path: java/vector/src/main/java/org/apache/arrow/vector/ipc/message/ArrowRecordBatch.java ########## @@ -232,6 +252,12 @@ public long computeBodyLength() { // round up size to the next multiple of 8 size = DataSizeRoundingUtil.roundUpTo8Multiple(size); } + + if (bodyCompression != null) { Review comment: Sounds reasonable. @rymurr had a similar suggestion. To make the bodyCompression non-null, we need a default compression codec that makes no compression/decompression. However, our specification does not support such an option now (Please see https://github.com/apache/arrow/blob/master/format/Message.fbs#L45-L53). Providing one would make the implementation not aligning with the specification. However, we have revised the PR to provide one, because it seems the C++ implementation is not aligning with the specification either (pls see https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/compression.h#L33) After that, we can guarantee that the bodyCompression is never null, and some other problems also go 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org