Prajwal-k-tech opened a new pull request, #26042: URL: https://github.com/apache/datafusion/pull/26042
## Which issue does this PR close? - Closes #26036. ## Rationale for this change After a LEFT, RIGHT, or FULL OUTER JOIN, the nullable side can contain rows whose columns were extended with NULLs. An equivalence such as `b = coalesce(a, 0)` is true on the input rows but does not remain true for those null-extended rows. Retaining it can lead to incorrect ordering and LIMIT results. ## What changes are included in this PR? - Filter nullable-side equivalence classes against a one-row all-NULL batch for the outer-join cases where that side may be null-extended. - Ignore volatile expressions during this check and discard classes that are no longer meaningful. - Add LEFT and FULL OUTER JOIN SQL regression cases, including the reported ORDER BY/LIMIT behavior. ## What is the testing strategy for this PR? - Verified the new SQL cases fail on the unmodified code and pass with this change. - `cargo test -p datafusion-sqllogictest --test sqllogictests -- joins` - `cargo test -p datafusion-physical-expr` (1,685 passed, 2 ignored; 13 doctests passed) - `RUST_BACKTRACE=1 cargo test -p datafusion` (passed) - `RUST_BACKTRACE=1 cargo test -p datafusion-cli` (passed) - `cargo clippy --all-targets --all-features -- -D warnings` (passed) - `cargo +1.99.0 fmt --all -- --check` and `git diff --check` (passed) This contribution was prepared with AI assistance. ## Are there any user-facing changes? This fixes incorrect query results for affected outer joins. There are no API changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
