Skip to content

simplify_expressions don't support different data type for binary #3556

@liukun4515

Description

@liukun4515

Describe the bug
A clear and concise description of what the bug is.

in the test case select_distinct_from

Run the test case, we will meet the error for optimizer:

[2022-09-21T05:22:53Z WARN  datafusion_optimizer::optimizer] Skipping optimizer rule 'simplify_expressions' due to unexpected error: Internal error: The type of Int64 IS DISTINCT FROM Int32 o
f binary physical should be same. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
[2022-09-21T05:22:53Z DEBUG datafusion_optimizer::optimizer] After apply pre_cast_lit_in_comparison rule:

In the optimizer we should these rules about type coercion first, and then do other optimization.
And the simplify expression should not depend on physical expr

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.

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