Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#51,613 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
86/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
data

Hướng nghiên cứu

Bắt đầu trong cpp/src/arrow/array/array_nested.cc tại ListFromListViewImpl và so sánh cách truy cập validity-bitmap của nó với FlattenListViewArray, đặc biệt là cách xử lý offset. Tái hiện vấn đề bằng ví dụ list-view đã được slice, sau đó thêm hoặc cập nhật một regression test để ListArray::FromListView và LargeListArray::FromListView giữ nguyên các giá trị null trong đầu vào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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++

Ngôn ngữ chính
C++
Star
17.1k
Fork
4.3k
Merge trung bình
4 ngày 5 giờ
Pull request đã merge (30 ngày)
106

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/arrow

Tất cả issue của apache/arrow

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.