apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.34k stars 3.48k forks source link

[Java] Incorrect message for IndexOutOfBoundsException in ArrowBuf.setBytes() #43048

Closed l-wang closed 3 months ago

l-wang commented 3 months ago

Describe the bug, including details regarding any error messages, version, and platform.

I am investigating an IndexOutOfBoundsException problem from the following stack trace.

(java.lang.IndexOutOfBoundsException) index: 0, length: 16 (expected: range(0, 16))
    org.apache.arrow.memory.ArrowBuf.setBytes():960
    org.apache.arrow.vector.DecimalVector.set():381
    org.apache.arrow.vector.DecimalVector.setSafe():471
    ....(omitting the rest of the stack)

The detailed message of this exception index: 0, length: 16 (expected: range(0, 16)) is not helpful, because the index and length are within the expected range. The problem is that the index that gets reported in this message is NOT the index that was checked.

arrow version: main plateform: Linux

Component(s)

Java

lidavidm commented 3 months ago

Issue resolved by pull request 43049 https://github.com/apache/arrow/pull/43049