maksimyego-db opened a new issue, #44626:
URL: https://github.com/apache/arrow/issues/44626

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   As reported in https://github.com/apache/arrow/issues/30866:
   > splitAndTransfer on vectors throws if the vector is completely empty and 
the offset buffer is empty.
   
   This is still the case for [MapVector in release 
18.0.0](https://github.com/apache/arrow/blob/release-18.0.0-rc0/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java#L214).
 We encounter this error with some regularity for a non-empty ListVector with a 
child MapVector:
   
   ```
   java.lang.IndexOutOfBoundsException: index: 0, length: 4 (expected: range(0, 
0))
        at org.apache.arrow.memory.ArrowBuf.checkIndexD(ArrowBuf.java:299) 
        at org.apache.arrow.memory.ArrowBuf.chk(ArrowBuf.java:285) 
        at org.apache.arrow.memory.ArrowBuf.getInt(ArrowBuf.java:405) 
        at 
org.apache.arrow.vector.complex.MapVector$TransferImpl.splitAndTransfer(MapVector.java:214)
 
        at 
org.apache.arrow.vector.complex.ListVector$TransferImpl.splitAndTransfer(ListVector.java:570)
 
   ```
   
   Here ListVector calls  `dataTransferPair.splitAndTransfer(/* startPoint =*/ 
0, /* sliceLength =*/ 0)` on a MapVector with `offsetBuffer.capacity()` of 0.
   
   The fix can be identical to that for BaseLargeVariableWidthVector, 
BaseVariableWidthVector and ListVector in 
https://github.com/apache/arrow/pull/41066
   
   ### Component(s)
   
   Java


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to