[Java] MurmurHasher doesn't take the final bytes into account if size % 4 != 0
- Linguagem predominante
- Java
- Estrelas
- 94
- Forks
- 152
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 11
Descrição
Minimal test case: all buffers of size 1 currently hash to the same value (-1684229222)
To my (admittedly untrained) eye, it looks like should range from `length - 1` rather than `index - 1`?
Also, should the nearby `index += 1` be removed, so that `i` and `index` don't meet in the middle? (`index` is being checked in the loop condition)
**Reporter**: [James Henderson](https://issues.apache.org/jira/browse/ARROW-15175) / @jarohen
**Note**: *This issue was originally created as [ARROW-15175](https://issues.apache.org/jira/browse/ARROW-15175). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Guia de contribuição
Direção de pesquisa
Abra java/memory/memory-core/src/main/java/org/apache/arrow/memory/util/hash/MurmurHasher.java na linha referenciada e reproduza o problema com buffers cujo tamanho não seja divisível por quatro, especialmente com tamanho 1. Rastreie os limites do loop e o tratamento do byte final e, em seguida, verifique se buffers com bytes finais diferentes não produzem mais o mesmo hash.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- data
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100