`convert_filters_to_predicate` negates a weakened AND, producing a predicate that drops matching rows
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Start in crates/datafusion/src/physical_plan/expr_to_predicate.rs, especially the AND handling at lines 370-382 and Expr::Not at lines 89-105. Reproduce the issue with the provided NOT (a = 1 AND upper(b) = 'X') expression, then verify that conversion returns None or only a predicate implied by the original filter.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When one side of an AND can't be converted, to_iceberg_and_predicate keeps only the other side (expr_to_predicate.rs#L370-L382). On its own that is fine for Inexact pushdown, because the result is weaker than the filter. Expr::Not then negates whatever its child produced (expr_to_predicate.rs#L89-L105). Negating a weaker predicate gives a stronger one, which rejects rows the original filter accepts.
To Reproduce
// schema: a INT, b STRING
let expr = SessionContext::new().parse_sql_expr("NOT (a = 1 AND upper(b) = 'X')", &df_schema)?;
let predicate = convert_filters_to_predicate(&[expr]);
// Some(NOT (a = 1)): drops a = 1, b = 'y', which the filter keeps
Expected behavior
The result is None, or another predicate implied by the filter. One way is to track whether each converted sub-predicate is exact, and negate only exact ones.
Additional context
SQL doesn't trigger this today with the default optimizer. DataFusion's simplifier rewrites NOT (A AND B) to NOT A OR NOT B before pushdown, so nothing is pushed for this filter. convert_filters_to_predicate is public, though, so other callers can hit it, as can any plan whose filters reach the scan without simplification. NOT (flag AND a = 1) on a boolean column has the same problem.
- Ngôn ngữ chính
- Rust
- Star
- 33
- Fork
- 34
- Merge trung bình
- 4 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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-iceberg
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/datafusion-iceberg#100 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
apache/datafusion-iceberg#101 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/datafusion-iceberg#85 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/datafusion-iceberg#84 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
apache/datafusion-iceberg#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/datafusion-iceberg
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
RustCrypto/utils#1597 ·
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 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Non-`main` default branchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
max-sixty/worktrunk#4727 · 7 bình luận · 1 reaction ·
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 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
carrick-sh/carrick#1859 ·
Maintainer thường phản hồi trong vòng 1 ngày