Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[C++] ListArray::FromListView gives wrong nulls for sliced list-view arrays

オープン 初心者向け
#51,613 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

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

評価

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

調査の方向性

cpp/src/arrow/array/array_nested.cc の ListFromListViewImpl から始め、特にオフセットの処理に注目して、その validity bitmap へのアクセスを FlattenListViewArray と比較してください。スライスされた list-view の例で問題を再現し、その後、ListArray::FromListView と LargeListArray::FromListView が入力の null を保持するように、回帰テストを追加または更新してください。

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

説明

Component: C++
Describe the bug, including details regarding any error messages, version, and platform.

ListArray::FromListView (and LargeListArray::FromListView) returns the wrong validity for a sliced list-view array with nulls.

auto views = arrow::json::ArrayFromJSONString(
                 arrow::list_view(arrow::int32()),
                 "[[1], [2], [3], [4], [5], [6], [7], [8], null, [10], [11]]")
                 .ValueOrDie();
auto sliced = std::static_pointer_cast<arrow::ListViewArray>(views->Slice(1));
auto lists =
    arrow::ListArray::FromListView(*sliced, arrow::default_memory_pool()).ValueOrDie();
// is null (list view): 0 0 0 0 0 0 0 1 0 0
// is null (list):      0 0 1 1 1 1 1 1 1 1

Expected: the same nulls as the input.

In ListFromListViewImpl (cpp/src/arrow/array/array_nested.cc), the validity bitmap is read with list_view_data->GetValues<uint8_t>(0), which already advances the pointer by offset bytes. It is then passed to bit_util::GetBit(in_validity_bitmap, list_view_data->offset + i), which applies the offset again, in bits. FlattenListViewArray in the same file does this correctly with GetValues<uint8_t>(0, 0).

Found while trying to use FromListView in a compute kernel (GH-33295). Related: GH-51612, where the list_view to list cast could use FromListView. Reproduced on current main, Linux x86_64.

Component(s)

C++

主要言語
C++
スター
17.1k
フォーク
4.3k
平均マージ
4日 3時間
マージ済み PR(30日)
100

環境構築

はじめの一歩

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

apache/arrow のほかの issue

apache/arrow の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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