Skip to content

Conversation

@andygrove
Copy link
Member

@andygrove andygrove commented Oct 7, 2022

Which issue does this PR close?

Part of #2175

Rationale for this change

There were recent discussions (see #2175) about making Expr more consistent with LogicalPlan where variants wrap structs. There seemed to be consensus that this was the direction we want to go.

I have not seen anyone start on this so thought I would get the ball rolling.

This PR applies this for Expr::Case.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Changes to the physical-expr crates sql SQL Planner labels Oct 7, 2022
@andygrove
Copy link
Member Author

@mingmwang @yjshen @jackwener fyi

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

LGTM

when_then_expr,
else_expr,
} => {
Expr::Case(case) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you wanted to avoid &case I think you could do like

Suggested change
Expr::Case(case) => {
Expr::Case(Case {
expr,
when_then_expr,
else_expr,
}) => {

Maybe the & is nicer syntax 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I debated between the two styles too. I don't have a strong preference either way

@andygrove andygrove merged commit 488b2ce into apache:master Oct 8, 2022
@andygrove andygrove deleted the case-struct branch October 8, 2022 00:18
@ursabot
Copy link

ursabot commented Oct 8, 2022

Benchmark runs are scheduled for baseline = 567ca5d and contender = 488b2ce. 488b2ce is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Changes to the physical-expr crates sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants