bodduv opened a new issue, #1125:
URL: https://github.com/apache/arrow-java/issues/1125

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   ## What happens
   
   On 19.0.0 (and on master), calling `setPosition` on a `ListVector` that came 
off the wire via IPC with `valueCount == 0` throws `IndexOutOfBoundsException`.
   
   Some callers may hit this without touching `setPosition` themselves as
   - `SingleStructReaderImpl.reader(String)` calls `setPosition(idx())` the 
first time a child reader on a struct is looked up.
   - `UnionMapReader` inherits from `UnionListReader` and breaks the same way.
   - `UnionLargeListReader` has a related variant; capacity guard seems to be 
missing and it fails whenever the offset buffer is shorter than `(idx + 2) * 8` 
bytes.
   
   The reader code hasn't changed. `ListVector.setReaderAndWriterIndex` changes 
and now correctly emits the leading `[0]` offset when `valueCount == 0` (as per 
the Arrow spec), so the receiver's offset buffer is no longer "zero-capacity" 
and if block `capacity() == 0` never enters.
   
   ## Repro
   
   The shape we actually hit — a struct with a list-typed child, struct itself 
having `valueCount == 0`:
   
   ```java
   StructVector parent = ...;            // child "l" is LIST<INT>, valueCount 
== 0
   parent.getReader().reader("l");       // IOOBE
   ```
   


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