apache / apache/arrow-java

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

未关闭
#273 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Type: bug
主要语言
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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。