simplify between expr should consider the data type
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
the three exprs expr1 between expr2 and expr3 should have the same data type or can be converted to the same data type.
In this pr, we remove the type coercion in the physical phase.
The below rule in the simplify_expression.rs should can be done when the type of expr,low,high is same, because we can move the type coercion to the beginning of the optimizer for some reason https://github.com/apache/arrow-datafusion/issues/3582 which will be done in the next pr
Between {
expr,
low,
high,
negated,
} => {
if negated {
let l = *expr.clone();
let r = *expr;
or(l.lt(*low), r.gt(*high))
} else {
and(expr.clone().gt_eq(*low), expr.lt_eq(*high))
}
}
After https://github.com/apache/arrow-datafusion/issues/3582 done, we can ignore the type checker for this rule.
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.