-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
In the Implement DECIMAL type, I want to implement the decimal data type in datafusion.
In the survey period, I take a look the type coercion in the current datafusion, and find some confused points.
For example:
AggFunction
logical expr:
agg(input_exprs)
In the expression evaluation, we need to coercion the expr and calc the result type of AggFunction expr.
In the current code, the logical result type use this API return_type, but get the physical expr result type use this API create_agg_expr.
These two API have a gap, which is coerce. In the coerce, the input expr may be added try_cast and change the data type. The result data type of inferred physical expr may be diff with the logical result data type.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
plan
- rule for AggregateFunction Add coercion rules for AggregateFunctions #1387
- rule for binary operator: comparison operation
- rule for ScalarFunction
- rule for ScalarUDF
- rule for WindowFunction
- rule for AggregateUDF
- other