liyafan82 commented on a change in pull request #7326: URL: https://github.com/apache/arrow/pull/7326#discussion_r479017596
########## File path: java/vector/src/main/java/org/apache/arrow/vector/ipc/message/ArrowRecordBatch.java ########## @@ -194,12 +190,17 @@ public int writeTo(FlatBufferBuilder builder) { int nodesOffset = FBSerializables.writeAllStructsToVector(builder, nodes); RecordBatch.startBuffersVector(builder, buffers.size()); int buffersOffset = FBSerializables.writeAllStructsToVector(builder, buffersLayout); - int compressOffset = bodyCompression.writeTo(builder); + int compressOffset = 0; + if (bodyCompression != null) { Review comment: @emkornfield Thanks for your good idea. I have updated the code accordingly. ---------------------------------------------------------------- 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