ListVector#getBuffers returns buffers in the wrong order for usage of VectorLoader
- Dominant language
- Java
- Stars
- 94
- Forks
- 152
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 11
Description
Calling [getBuffers](https://github.com/apache/arrow/blob/06ca00c2daeeb0d6461e7b6bec51679c19b5b92b/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java#L652-L653) on a ListVector adds the offsetBuffers first and the validityBuffer second. When a ListVector is populated by [loadFieldBuffers](https://github.com/apache/arrow/blob/06ca00c2daeeb0d6461e7b6bec51679c19b5b92b/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java#L183-L189) (e.g. via a VectorLoader), the validityBuffer is read first and the offsetBuffer is read second. The resulting vector represents different data than the originating vector.
**Reporter**: [Paul Horn](https://issues.apache.org/jira/browse/ARROW-16377)
**Note**: *This issue was originally created as [ARROW-16377](https://issues.apache.org/jira/browse/ARROW-16377). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start in java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java, reading getBuffers and loadFieldBuffers together, then trace how VectorLoader consumes the buffers. Done means a ListVector serialized by getBuffers and loaded through loadFieldBuffers represents the same data, with the validity and offset buffers handled consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100