mikamikasuki opened a new pull request, #26059:
URL: https://github.com/apache/datafusion/pull/26059

   ## Which issue does this PR close?
   
   - Closes #26058.
   
   ## Rationale for this change
   
   The query in #26058 returns 42 rows instead of the two rows that satisfy its 
CASE-based join condition. EliminateCrossJoin extracts that equality from the 
original ON clause, but drops it when it cannot attach the key to one of the 
rebuilt joins.
   
   ## What changes are included in this PR?
   
   Preserve original ON keys that cannot be assigned to a rebuilt inner join as 
residual filters. Use a null-safe comparison for keys from joins configured 
with NullEqualsNull.
   
   ## What is the testing strategy for this PR?
   
   Added the issue query to joins.slt and an optimizer unit test for retaining 
null-equal residual keys. The focused optimizer tests (27), the joins.slt 
tests, and the full extended workspace test suite pass. Formatting and 
optimizer clippy checks also pass.
   
   ## Are there any user-facing changes?
   
   Queries with CASE-based join keys spanning multiple inputs return only rows 
that satisfy the original join condition.


-- 
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]

Reply via email to