Yicong-Huang commented on code in PR #967:
URL: https://github.com/apache/arrow-java/pull/967#discussion_r2714025607


##########
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
+      offsetBuffer.writerIndex(Math.min(OFFSET_WIDTH, 
offsetBuffer.capacity()));

Review Comment:
   I removed the if clause to use `offsetBuffer.writerIndex((valueCount + 1) * 
OFFSET_WIDTH)` for all cases.



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