apache / apache/arrow-java

[Java] offset buffer for vector of variable-width type with zero value count is empty

Aperta
#273 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Type: bug
Lingua principale
Java
Stelle
94
Fork
152
Merge medio
3g 16h
PR unite (30g)
11

Descrizione

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.*

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con org.apache.arrow.vector.BaseVariableWidthVector, concentrandoti sull’inizializzazione del buffer degli offset e su getBufferSize quando il conteggio dei valori è zero. Confronta il comportamento Java con l’array binario vuoto di pyarrow mostrato nel report; il lavoro è concluso quando il caso con zero valori espone l’offset di quattro byte previsto con valore zero e restituisce la dimensione del buffer corrispondente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
data-engineering
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.