Skip to content

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
@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)
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

N/A

## Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

We apply the Comet diff to Spark when upgrading Spark to use new Comet
releases. We should then reset the diff because it is no longer needed
(until we make future changes).

We should have done this for the 0.10 upgrade, but did not.

## What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

Reset the diff. The diff is now an empty file.

## How are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
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