[Java] offset buffer for vector of variable-width type with zero value count is empty
- Linguagem predominante
- Java
- Estrelas
- 94
- Forks
- 152
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 11
Descrição
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.*
Guia de contribuição
Direção de pesquisa
Comece com org.apache.arrow.vector.BaseVariableWidthVector, concentrando-se na inicialização do buffer de offsets e em getBufferSize quando a contagem de valores é zero. Compare o comportamento do Java com o array binário vazio de pyarrow mostrado no relatório; considera-se concluído quando o caso de zero valores expõe o offset de quatro bytes esperado com valor zero e informa o tamanho de buffer correspondente.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- data-engineering
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 45/100