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


##########
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:
   `fieldNode.getLength()=3` as expected from slicing. Which means, we exactly 
don't know which 3 values to read here. I thought, since there is slicing, we 
need to read more from that buffer meaning, additional `arrowArrayOffset` 
amount. 
   
   > But we should be adjusting the start of the buffer, not the capacity?
   
   I completely agree, but I couldn't figure out a way to do that from the 
current code, we cannot provide a starting point, but a capacity to read from 
the beginning. Should we improve the memory read component? 



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