myandpr opened a new pull request, #20965: URL: https://github.com/apache/datafusion/pull/20965
## Which issue does this PR close? - Closes #20356. ## Rationale for this change Invalid expressions such as `1 + 'a'` are already rejected during logical planning in `SELECT`, but equivalent expressions in other SQL clauses were still deferred until later phases. This leads to inconsistent behavior in logical planning and `SessionContext::sql(...)`, especially for wrapped expressions such as `STARTS_WITH() IS NULL`. ## What changes are included in this PR? - add eager clause expression validation in the SQL planner - apply it to `WHERE`, `HAVING`, `QUALIFY`, `ORDER BY`, and `JOIN ... ON` - recursively validate clause expressions so wrapped invalid expressions are also rejected during logical planning ## Are these changes tested? Yes. Added regression tests for invalid expressions in: - `WHERE` - `HAVING` - `QUALIFY` - `ORDER BY` - `JOIN ... ON` This includes both direct invalid expressions like `(1 + 'a')` and wrapped invalid expressions like `(STARTS_WITH() IS NULL)`. ## Are there any user-facing changes? Yes. Invalid expressions in these clauses now fail earlier during logical planning. -- 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]
