SubhamSinghal opened a new pull request, #21303: URL: https://github.com/apache/datafusion/pull/21303
## Which issue does this PR close? EliminateOuterJoin does not recognize **InList** and **Between** as null-rejecting expressions - Closes https://github.com/apache/datafusion/issues/21302 ## Rationale for this change The EliminateOuterJoin optimizer rule converts outer joins to inner joins when WHERE clause predicates reject null rows from the nullable side. However, extract_non_nullable_columns only recognizes a limited set of expression types (comparisons, AND/OR, NOT, IS NOT NULL, CAST/TRY_CAST) and falls through to a no-op for all others. This means common null-rejecting expressions like IN and BETWEEN are not recognized, causing outer joins to be preserved unnecessarily. ## What changes are included in this PR? Added `Expr::InList` and `Expr::Between` handling to extract_non_nullable_columns in eliminate_outer_join.rs. Both expressions are null-rejecting on their input column — if the input is NULL, the result is always NULL regardless of the list/range contents. ## Are these changes tested? Yes, 8 new unit tests added ## Are there any user-facing changes? 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]
