andygrove opened a new issue, #11490: URL: https://github.com/apache/datafusion/issues/11490
### Is your feature request related to a problem or challenge? For expressions such as `IF(predicate, true_expr, false_expr)` or `CASE WHEN predicate THEN true_expr ELSE false_expr END`, we generally have to be careful to only evaluate the `true_expr` against rows where the `predicate` evaluated to true. However, if we know that `true_expr` has no side effects (such as throwing exceptions on invalid inputs) and is inexpensive to compute, then we have the option of evaluating it for all rows instead, which can be considerably cheaper in some cases. There is currently no way to determine if a `PhysicalExpr` has side effects. I would like to discuss adding a new method to the trait with a default implementation. Something like ```rust fn has_side_effects(&self) -> bool { false } ``` ### Describe the solution you'd like _No response_ ### Describe alternatives you've considered _No response_ ### Additional context _No response_ -- 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.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