vibhatha commented on code in PR #43053:
URL: https://github.com/apache/arrow/pull/43053#discussion_r1690683271


##########
java/c/src/main/java/org/apache/arrow/c/BufferImportTypeVisitor.java:
##########
@@ -116,7 +119,7 @@ private ArrowBuf importFixedBytes(ArrowType type, int 
index, long bytesPerSlot)
   }
 
   private ArrowBuf importOffsets(ArrowType type, long bytesPerSlot) {
-    final long capacity = bytesPerSlot * (fieldNode.getLength() + 1);
+    final long capacity = bytesPerSlot * (fieldNode.getLength() + 
arrowArrayOffset + 1);

Review Comment:
   If we don't add the `arrowArrayOffset` then we get 4 slots, which are the 
first four slots, but what we need is not the first 4 slots, but the from 
`arrowArrayOffset` + 4 slots. And then we have to get the adjusted offset from 
this since Java doesn't need to keep the whole offset buffer like C++.  Am I 
missing something here? 



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