Null-aware hash join loses `NOT IN` semantics when converted to `SymmetricHashJoinExec`

Đang mở
#27,225 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 1 ngày

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

  • #27226 của @shehabgamin — đã đóng, không merge

Đá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
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
databases

Hướng nghiên cứu

Start by reading JoinSelection and SymmetricHashJoinExec in DataFusion’s Rust source, then trace the null_aware handling for HashJoinExec. Add or use a regression test that builds the null-aware LeftAnti join described in the issue and runs JoinSelection. Done means optimization keeps it as HashJoinExec; an open linked pull request already addresses this issue.

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

Mô tả

bug
Describe the bug

JoinSelection turns a HashJoinExec into a SymmetricHashJoinExec when both inputs are unbounded. It does this without checking null_aware. SymmetricHashJoinExec has no null-aware mode, so the flag is dropped and a NOT IN join becomes a plain anti join. A NULL in the subquery, or a NULL outer value, no longer gives SQL NOT IN semantics, so the query can return rows it should not.

To Reproduce

Build a null-aware LeftAnti HashJoinExec over two unbounded inputs and run JoinSelection on it. The result is a SymmetricHashJoinExec, and the null-aware behavior is gone.

let join = HashJoinExec::try_new(
    left, right, on, None, &JoinType::LeftAnti, None,
    PartitionMode::CollectLeft, NullEquality::NullEqualsNothing,
    true, // null_aware
)?;
let optimized = JoinSelection::new().optimize(Arc::new(join), &ConfigOptions::new())?;
// optimized is a SymmetricHashJoinExec
Expected behavior

A null-aware join stays a HashJoinExec, the only join that implements null-aware semantics for this case.

Additional context

No response

Willingness to contribute

I plan to contribute a fix for this bug independently

Ngôn ngữ chính
Rust
Star
9.6k
Fork
2.6k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
345

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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/datafusion

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

Issue tương tự

Thêm issue về Rust

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.