[Java] MurmurHasher doesn't take the final bytes into account if size % 4 != 0
- Lenguaje dominante
- Java
- Estrellas
- 94
- Forks
- 152
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 11
Descripción
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.*
Guía de contribución
Línea de trabajo
Abre java/memory/memory-core/src/main/java/org/apache/arrow/memory/util/hash/MurmurHasher.java en la línea referenciada y reproduce el problema con búferes cuyo tamaño no sea divisible entre cuatro, especialmente con el tamaño 1. Sigue los límites del bucle y el tratamiento del byte final, y verifica después que los búferes con bytes finales diferentes ya no produzcan el mismo hash.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- data
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100