[C++] ListArray::FromListView gives wrong nulls for sliced list-view arrays
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 cpp/src/arrow/array/array_nested.cc 中的 ListFromListViewImpl 开始,将其对 validity-bitmap 的访问方式与 FlattenListViewArray 进行比较,尤其关注 offset 的处理。使用切片后的 list-view 示例重现该问题,然后添加或更新回归测试,以确保 ListArray::FromListView 和 LargeListArray::FromListView 保留输入中的 null。
由索引模型根据 Issue 内容生成。
描述
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 天 5 小时
- 30 天内合并 PR
- 106
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/arrow 的其他 Issue
-
Component: C++ Type: enhancement
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复
-
Component: GLib
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复
-
Component: Python Type: enhancement
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
Component: Continuous Integration Component: MATLAB Type: enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
[C++][Parquet] Update bundled Apache Thrift to 0.24.0 for CVE-2026-55969可能已有人在做 @Hanayoshi-8744 于 3 天前认领。 未关闭Component: C++ Component: Parquet Type: enhancement
难度 2/5 1-3 小时 新手友好度 76/100
apache/arrow#51354 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
cp-algorithms/cp-algorithms#1715 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Icinga/icinga2#11058 · 1 条评论 ·
维护者通常 1 天内回复
-
status:needs-triage
难度 2/5 1-3 小时 新手友好度 88/100
PX4/PX4-Autopilot#28924 ·
维护者通常 1 天内回复
-
component: split-view platform: windows
难度 2/5 1-3 小时 新手友好度 74/100
zen-browser/desktop#15616 · 1 个 reaction ·
维护者通常 1 天内回复