[Java] Improve VectorSchemaRoot.getVector(String name) lookup performance
- 主要言語
- Java
- スター
- 94
- フォーク
- 152
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 11
説明
### Describe the enhancement requested
The Java `VectorSchemaRoot.getVector(String name)` can be quite slow if a schema has many vectors. The code currently loops over all the field vectors until it finds the string match. [Link to code](https://github.com/apache/arrow-java/blob/3bc34b041761081ac32a7cd3b167f9ab8b628677/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java#L175).
Could we stroe a hash map of the `FieldVector` String name to the actual `FieldVector`? Basically the same thing as the `fieldVectorsMap` that maps the `Field` to `FieldVector`. For really wide datasets the trade off of a bit more memory for faster vector lookups would be really nice to have!
Happy to open up a PR with the improvement, thanks!
コントリビューションガイド
調査の方向性
Start in vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java at getVector(String name), then inspect the existing fieldVectorsMap and the construction paths for field vectors. Confirm the name-based lookup preserves current behavior and compare it on a schema with many vectors; done means repeated name lookups no longer scan every field vector.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data, performance
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 72/100