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

fix: incorrect simplification of case expr #7006

Merged
merged 2 commits into from
Jul 18, 2023
Merged

fix: incorrect simplification of case expr #7006

merged 2 commits into from
Jul 18, 2023

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Jul 18, 2023

Which issue does this PR close?

Closes #7004.

Rationale for this change

This rule should only be applied if the base subexpression is not present.

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jul 18, 2023
Copy link
Member

@jackwener jackwener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jonahgao

Comment on lines +1072 to +1075
Expr::Case(Case {
expr: None,
when_then_expr,
else_expr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jackwener jackwener merged commit 796f5f5 into apache:main Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CASE expression simplification and type coercion error
2 participants