Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] MapVector.splitAndTransfer throws for empty vector #44626

Open
maksimyego-db opened this issue Nov 3, 2024 · 1 comment
Open

[Java] MapVector.splitAndTransfer throws for empty vector #44626

maksimyego-db opened this issue Nov 3, 2024 · 1 comment

Comments

@maksimyego-db
Copy link

maksimyego-db commented Nov 3, 2024

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

@myegorov
Copy link

myegorov commented Nov 3, 2024

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants