apache / apache/arrow-java

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

オープン
#273 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
Type: bug
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
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 に焦点を当てます。レポートに示されている空の pyarrow バイナリ配列と Java の動作を比較します。ゼロ値のケースで、期待される 4 バイトのゼロオフセットが公開され、対応するバッファーサイズが報告されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
data-engineering
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。