`UnionListReader.setPosition` throws IOOBE on a post-IPC empty List
- 主要言語
- Java
- スター
- 94
- フォーク
- 152
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 11
説明
### Describe the bug, including details regarding any error messages, version, and platform.
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, valueCount == 0
parent.getReader().reader("l"); // IOOBE
```
コントリビューションガイド
調査の方向性
UnionListReader.setPosition から始め、SingleStructReaderImpl.reader(String) からの呼び出しを追跡します。Issue で説明されている関連する UnionMapReader と UnionLargeListReader のパスと比較します。IPC 後の空のリストのケースを再現し、その後、offset または capacity が空であるか想定より短い場合でも、これらの reader が IndexOutOfBoundsException をスローしなくなっていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 67/100