Dandandan opened a new issue #237: URL: https://github.com/apache/arrow-datafusion/issues/237
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** The (logical) optimizer contains some support for folding (boolean) constants. This can help, especially with other optimization passes, to optimize queries. For example, `LIMIT (0 + 0)` could be optimized first to `LIMIT 0`, to enable eliminating the whole plan. We should try to extend this support to most datatypes & expressions. **Describe the solution you'd like** `Expr`s can already be evaluated against a `RecordBatch`, and there is code to evaluate scalar values without going through Arrow. To make sure that the constant evaluation is implemented correctly & the same as the evaluation code, we should be able to reuse the code from there. **Describe alternatives you've considered** Manually implement the constant folding support. Downside here is that we end up with two implementations, which has a higher maintenance burden. **Additional context** Not in scope: add it to physical optimizer too. Here it could help too, especially if we have support for partitions. -- 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. For queries about this service, please contact Infrastructure at: [email protected]
