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

perf: Optimize IfExpr by delegating to CaseExpr #681

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Jul 18, 2024

Which issue does this PR close?

Closes #680

Rationale for this change

Rather than maintain a custom IfExpr, we can just delegate to CaseExpr and benefit from recent optimization work there.

image

What changes are included in this PR?

  • IfExpr now is just a wrapper for CaseExpr
  • I moved the cast benchmarks into the spark-expr crate

How are these changes tested?

@andygrove andygrove changed the title chore: Add crtierion benchmarks for conditional expressions (IF & CASE) chore: Add criterion benchmarks for conditional expressions (IF & CASE) Jul 18, 2024
@andygrove andygrove force-pushed the bench-conditional branch from 30fe587 to 9b886d9 Compare July 24, 2024 15:03
@andygrove andygrove changed the title chore: Add criterion benchmarks for conditional expressions (IF & CASE) perf: Optimize IfExpr by delegating to CaseExpr Jul 24, 2024
@andygrove
Copy link
Member Author

andygrove commented Jul 24, 2024

Note that there is a small regression in the expr or expr case, so I think we can optimize this upstream. I will file an issue against DataFusion for this.

edit: Issue filed as apache/datafusion#11638

Copy link
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR @andygrove

@andygrove andygrove merged commit ded3dd6 into apache:main Jul 24, 2024
82 checks passed
@andygrove andygrove deleted the bench-conditional branch July 24, 2024 21:11
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
* Unify IF and CASE expressions

* revert test changes

* fix

(cherry picked from commit ded3dd6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify IF and CASE expressions
2 participants