[Java] offset buffer for vector of variable-width type with zero value count is empty
- 主要語言
- Java
- 星號
- 94
- 分支
- 152
- 平均合併
- 3 天 16 小時
- 30 天內合併 PR
- 11
描述
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.*
貢獻指南
研究方向
從 org.apache.arrow.vector.BaseVariableWidthVector 開始,重點關注值計數為零時的偏移緩衝區初始化和 getBufferSize。將 Java 的行為與報告中展示的空 pyarrow 二進位陣列進行比較;當零值情況暴露出預期的四位元組零偏移量並回報相應的緩衝區大小時,即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- data-engineering
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100