[Java] Improve VectorSchemaRoot.getVector(String name) lookup performance
- 主要语言
- Java
- 星标
- 94
- 派生
- 152
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 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