Native MergeRows can panic or produce wrong masks - arrow 59 `and_not` mishandles sliced arrays
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
- 76/100
Hướng nghiên cứu
Bắt đầu trong merge_rows.rs, khoảng dòng 625–626, và theo dõi cách MergeRowsStream tạo các mặt nạ cho những hàng không khớp. Tái hiện hành vi của Arrow 59 bằng ví dụ mảng đã cắt được cung cấp, sau đó xác minh các mặt nạ khớp với and(a, not(b)) và MergeRows gốc không còn panic; issue đề xuất thay thế hai lệnh gọi and_not như một giải pháp tạm thời.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Scala
- Star
- 1.3k
- Fork
- 418
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 158
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/datafusion-comet
-
`IcebergWriteExec` and `CometIcebergWriteExec` are marked with `!` (missing input) in EXPLAINCó thể đã có người làm @Visorgood đã nhận hôm nay. Đang mởbug requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/datafusion-comet#7622 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion-comet#7583 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug priority:medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
apache/datafusion-comet#7559 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:writer bug priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7558 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Comet Native Executors: run a query in Spark when Comet is turned offCó thể đã có người làm @andygrove đã nhận 8 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7557 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/datafusion-comet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
lichess-org/lila#22506 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Huerte/algo-solutions-python#260 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
cpp-best-practices/project_validator#245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
python 🐍 Task 🔧
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
valkey-io/valkey-glide#7709 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zio/zio-logging#1181 ·
Maintainer thường phản hồi trong vòng 1 ngày