Avro adapter: setPosition doesn't work with BaseVariableWidthVectors

オープン
#833 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java
領域
data

調査の方向性

まず、BaseVariableWidthVector ベースの VarBinaryVector および VarCharVector インスタンスを使用した Avro アダプターの Consumer.setPosition の動作を追跡します。書き込みシーケンス 0、2、1、3 を再現し、リグレッションテストを追加します。これらのベクターで、位置指定によって以前に書き込まれたデータが消去されなくなるか、位置指定が妨げられなくなれば完了です。

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

説明

Type: bug
Describe the bug, including details regarding any error messages, version, and platform.

BaseVariableWidthVector-based vectors (VarBinaryVector, VarCharVector) expect the data to be written sequentially. This means Consumer.setPosition is not safe to use. Imagine the following scenario:

  • write index 0
  • write index 2
  • write index 1
  • write index 3

On the last step, BaseVariableWidthVector.fillHoles erases the data written for the index 2:

  protected final void fillHoles(int index) {
    for (int i = lastSet + 1; i < index; i++) {
      setBytes(i, emptyByteArray, 0, emptyByteArray.length);
    }
    lastSet = index - 1;
  }

Here, index would be 3, lastSet + 1 would be 2 (1 + 1), so setBytes(2, emptyByteArray, ...) is called.

Not sure what the right solution is here, but at a minimum, the library shouldn't allow calling setPosition for Consumers using BaseVariableWidthVector vectors.

主要言語
Java
スター
95
フォーク
154
平均マージ
2日 10時間
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/arrow-java のほかの issue

apache/arrow-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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