[Java] offset buffer for vector of variable-width type with zero value count is empty
- Lenguaje dominante
- Java
- Estrellas
- 94
- Forks
- 152
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 11
Descripción
I am reporting what I think might be two related bugs in `org.apache.arrow.vector.BaseVariableWidthVector`
1. The offset buffer is initialized as empty. I expect that it to have 4 bytes that represent the integer zero.
1. The `getBufferSize` method returns 0 when value count is zero, instead of 4.
Compare to the pyarrow implementation, which I believe correctly populates the offset buffer:
```java
>>> import pyarrow as pa
>>> array = pa.array([], type=pa.binary())
>>> array
[]
>>> print([b.hex().decode() for b in array.buffers()])
['', '00000000', '']
```
**Reporter**: [Steve M. Kim](https://issues.apache.org/jira/browse/ARROW-7342)
**Note**: *This issue was originally created as [ARROW-7342](https://issues.apache.org/jira/browse/ARROW-7342). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Guía de contribución
Línea de trabajo
Comienza con org.apache.arrow.vector.BaseVariableWidthVector, centrándote en la inicialización del búfer de offsets y en getBufferSize cuando el recuento de valores es cero. Compara el comportamiento de Java con el array binario vacío de pyarrow mostrado en el informe; se considera terminado cuando el caso de cero valores expone el offset de cuatro bytes esperado con valor cero e informa del tamaño de búfer correspondiente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- data-engineering
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100