Skip to content

The framework about expression type coercion #1356

@liukun4515

Description

@liukun4515

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions