You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/10 09:43:24 UTC

[GitHub] [arrow-datafusion] Dandandan opened a new issue, #3431: Evaluate expressions after type coercion

Dandandan opened a new issue, #3431:
URL: https://github.com/apache/arrow-datafusion/issues/3431

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   The recently added an optimizer pass that performs type coercion on the logical plan.
   There is some oppurtunity to simplify the expressions as often it creates casts on constants, like:
   
   `CAST(Int64(1) AS Float32)`
   
   This could be const evaluated to:
   `Float32(1.0)`
   
   Simplifying the plan and leaving more room for further optimization.
   
   **Describe the solution you'd like**
   When wrapping the expression in a cast, we can directly evaluate the result. Alternatively we could run the "simplify_expressions" again after type coercion, however this seems unneeded.
   It seems we can use the `evaluate_to_scalar` function to evaluate the created `Expr`
   https://github.com/apache/arrow-datafusion/blob/master/datafusion/optimizer/src/simplify_expressions.rs#L487
   
   **Describe alternatives you've considered**
   n/a
   
   **Additional context**
   


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] Dandandan closed issue #3431: Evaluate expressions after type coercion

Posted by GitBox <gi...@apache.org>.
Dandandan closed issue #3431: Evaluate expressions after type coercion 
URL: https://github.com/apache/arrow-datafusion/issues/3431


-- 
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-unsubscribe@arrow.apache.org

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