[Java] Improve VectorSchemaRoot.getVector(String name) lookup performance
- Linguagem predominante
- Java
- Estrelas
- 94
- Forks
- 152
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 11
Descrição
### 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!
Guia de contribuição
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- data, performance
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Pouca atividade
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 72/100