-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
Describe the bug, including details regarding any error messages, version, and platform.
As reported in #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. We encounter this error with some regularity for a non-empty ListVector with an empty 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 in #44627 can be identical to that for BaseLargeVariableWidthVector, BaseVariableWidthVector and ListVector in #41066
Component(s)
Java