Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify between expr should consider the data type #3587

Closed
liukun4515 opened this issue Sep 22, 2022 · 0 comments · Fixed by #3661
Closed

simplify between expr should consider the data type #3587

liukun4515 opened this issue Sep 22, 2022 · 0 comments · Fixed by #3661
Labels
enhancement New feature or request

Comments

@liukun4515
Copy link
Contributor

liukun4515 commented Sep 22, 2022

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 #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 #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant