viirya commented on code in PR #967:
URL: https://github.com/apache/arrow-java/pull/967#discussion_r2710836481


##########
vector/src/main/java/org/apache/arrow/vector/complex/LargeListVector.java:
##########
@@ -309,7 +320,8 @@ private void setReaderAndWriterIndex() {
     offsetBuffer.readerIndex(0);
     if (valueCount == 0) {
       validityBuffer.writerIndex(0);
-      offsetBuffer.writerIndex(0);
+      // Even when valueCount is 0, offset buffer should have offset[0] per 
Arrow spec

Review Comment:
   It is better to explain it clearly:
   ```suggestion
         // IPC serializer will determine readable bytes based on `readerIndex` 
and `writerIndex`.
         //  Both are set to 0 means 0 bytes are written to the IPC stream 
which will crash IPC readers
         // in other libraries. According to Arrow spec, we should still output 
the offset buffer which
         // is [0].
   ```



-- 
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]

Reply via email to