Native MergeRows can panic or produce wrong masks - arrow 59 `and_not` mishandles sliced arrays
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
调研方向
从 merge_rows.rs 第 625–626 行附近开始,追踪 MergeRowsStream 如何构建未匹配行的掩码。使用提供的切片数组示例重现 Arrow 59 的行为,然后验证掩码是否与 and(a, not(b)) 一致,以及原生 MergeRows 是否不再 panic;issue 建议将两处 and_not 调用替换作为临时解决方法。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
MergeRowsStream builds the "not matched" masks with arrow::compute::kernels::boolean::and_not (merge_rows.rs:625-626). In arrow 59.x and_not mixes up the offsets of its inputs when one of them is a slice (apache/arrow-rs#10698, fixed in apache/arrow-rs#10699 for 60.0.0, not backported). Comet main resolves arrow to 59.3.2, so the bug is still there.
After the full outer join one marker column can be a slice with a non-zero offset. Then the task either panics with offset + len out of bounds, or gets wrong masks with no error and applies inserts and deletes to the wrong rows. We hit the panic on Iceberg MERGE with spark.comet.exec.mergeRows.enabled=true (Comet 1.2.0, Spark 4.0.2); with the flag off the jobs pass.
Steps to reproduce
// arrow = "=59.3.2"
use arrow::array::{Array, BooleanArray};
use arrow::compute::kernels::boolean::{and, and_not, not};
fn mask(len: usize, f: fn(usize) -> bool) -> BooleanArray {
BooleanArray::from((0..len).map(f).collect::<Vec<_>>())
}
fn main() {
let left = mask(3000, |i| i % 3 != 0).slice(0, 1000);
let right = mask(2000, |i| i % 5 == 0).slice(1000, 1000);
let expected = and(&left, ¬(&right).unwrap()).unwrap();
let actual = and_not(&left, &right).unwrap();
let wrong = (0..1000).filter(|&i| actual.value(i) != expected.value(i)).count();
println!("wrong values: {wrong} of 1000"); // 59.x: 533, 60.1: 0
}
Expected behavior
and_not(a, b) gives the same result as and(a, not(b)), and native MergeRows does not panic.
Additional context
Until Comet moves to arrow 60 (#7249), replacing the two calls with and(a, ¬(b)?) fixes it.
Willingness to contribute
I can contribute a fix for this bug independently
- 主要语言
- Scala
- 星标
- 1.3k
- 派生
- 418
- 平均合并
- 2 天 23 小时
- 30 天内合并 PR
- 158
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-comet 的其他 Issue
-
`IcebergWriteExec` and `CometIcebergWriteExec` are marked with `!` (missing input) in EXPLAIN可能已有人在做 @Visorgood 今天认领。 未关闭bug requires-triage
难度 2/5 1-3 小时 新手友好度 65/100
apache/datafusion-comet#7622 · 2 条评论 ·
维护者通常 2 天内回复
-
requires-triage
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion-comet#7583 ·
维护者通常 2 天内回复
-
bug priority:medium
难度 2/5 1-3 小时 新手友好度 73/100
apache/datafusion-comet#7559 · 2 条评论 ·
维护者通常 2 天内回复
-
area:writer bug priority:low
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#7558 ·
维护者通常 2 天内回复
-
Comet Native Executors: run a query in Spark when Comet is turned off可能已有人在做 @andygrove 于 8 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#7557 ·
维护者通常 2 天内回复
查看 apache/datafusion-comet 的全部 Issue
相似的 Issue
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 python 🐍
难度 2/5 1-3 小时 新手友好度 62/100
valkey-io/valkey-glide#7722 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
lichess-org/lila#22506 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
scala/docs.scala-lang#3328 ·
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
难度 1/5 1 小时以内 新手友好度 68/100
Huerte/algo-solutions-python#260 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
cpp-best-practices/project_validator#245 ·
维护者通常 1 天内回复