[Java] offset buffer for vector of variable-width type with zero value count is empty
- Langage dominant
- Java
- Étoiles
- 94
- Forks
- 152
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 11
Description
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.*
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par org.apache.arrow.vector.BaseVariableWidthVector, en vous concentrant sur l’initialisation du tampon d’offsets et sur getBufferSize lorsque le nombre de valeurs est nul. Comparez le comportement Java avec le tableau binaire vide de pyarrow présenté dans le rapport ; le travail est terminé lorsque le cas de zéro valeur expose l’offset de quatre octets attendu, égal à zéro, et indique la taille de tampon correspondante.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- data-engineering
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100