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

   ## Which issue does this PR close?
   
   * Closes #16973
   
   ## Rationale for this change
   
   Previously, inferred predicates that couldn't be pushed down through a join 
(due to join type restrictions) were discarded. This behavior missed 
opportunities to apply dynamic filter pushdown later in the optimization 
pipeline. By retaining such predicates as join filters, we enable further 
optimization opportunities and improve query performance.
   
   ## What changes are included in this PR?
   
   * Updated `push_down_all_join` logic to retain inferred predicates as join 
filters when they can't be pushed down to either side.
   * Adjusted plan formatting to reflect join filters.
   * Added new test cases to cover:
   
     * Dynamic filter pushdown in left and right joins.
     * Correct handling of null-filtering predicates.
     * Ensuring proper formatting of optimized logical plans.
   
   ## Are these changes tested?
   
   Yes, this PR includes multiple unit tests to verify the correctness of the 
optimizer behavior for:
   
   * Left and right joins with pushable inferred predicates
   * Joins with predicates that allow nulls (ensuring dynamic filters are not 
incorrectly generated)
   * Plan formatting with join filters
   
   ## Are there any user-facing changes?
   
   Yes:
   
   * The optimized logical plan now includes inferred join filters that were 
previously dropped.
   * This results in improved visibility into the logical plan and enables 
downstream dynamic filter optimizations.
   
   These changes are internal to query optimization and do not alter public 
APIs, but users may observe better query performance and more comprehensive 
filter handling in EXPLAIN plans.
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to