You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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" pass again after type coercion, however this seems unneeded.
It seems we can use the evaluate_to_scalar function / ConstEvaluator to evaluate the created Expr in the type coercion, after applying it to an expression. https://github.com/apache/arrow-datafusion/blob/master/datafusion/optimizer/src/simplify_expressions.rs#L487
Describe alternatives you've considered
n/a
Additional context
The text was updated successfully, but these errors were encountered:
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 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" pass again after type coercion, however this seems unneeded.
It seems we can use the
evaluate_to_scalar
function /ConstEvaluator
to evaluate the createdExpr
in the type coercion, after applying it to an expression.https://github.com/apache/arrow-datafusion/blob/master/datafusion/optimizer/src/simplify_expressions.rs#L487
Describe alternatives you've considered
n/a
Additional context
The text was updated successfully, but these errors were encountered: