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

MINOR: Optimizer example and docs, deprecate Expr::name #3788

Merged
merged 16 commits into from
Oct 12, 2022

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Oct 10, 2022

Which issue does this PR close?

N/A

Rationale for this change

I want to make it easier for new contributors to be able to write and review optimization rules.

You can see the rendered version of the new README here

What changes are included in this PR?

  • Example
  • Docs
  • Rename Expr::name() to Expr::display_name()
  • Add deprecated Expr::name() that delegates to Expr::display_name()

Are there any user-facing changes?

No

@github-actions github-actions bot added the optimizer Optimizer rules label Oct 10, 2022
@andygrove andygrove added optimizer Optimizer rules documentation Improvements or additions to documentation and removed optimizer Optimizer rules labels Oct 10, 2022
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Oct 11, 2022
@andygrove andygrove marked this pull request as ready for review October 11, 2022 23:18
Comment on lines 74 to 76
/// `OptimizerRule` transforms one ['LogicalPlan'] into another which
/// computes the same results, but in a potentially more efficient
/// way.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to emphasize that in the event of there are no transformations to apply (for the given input), the optimizer could (and should) return the input as is (e.g. instead of failing with an exception)?

/// `OptimizerRule` can transform one ['LogicalPlan'] into another which
/// computes the same results, but in a potentially more efficient way. If
/// there are no suitable transformations for the input plan, the optimizer can
/// simply return it as is.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a very good point. I will add this.

@andygrove andygrove added the documentation Improvements or additions to documentation label Oct 12, 2022
@andygrove andygrove requested review from alamb and liukun4515 October 12, 2022 13:19
@github-actions github-actions bot added logical-expr Logical plan and expressions and removed documentation Improvements or additions to documentation labels Oct 12, 2022
@alamb alamb changed the title MINOR: Optimizer example and docs MINOR: Optimizer example and docs, deprecate Expr::name Oct 12, 2022
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.

very nice @andygrove 👌

@@ -0,0 +1,163 @@
// Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally recommend putting this example into datafusion/examples rather than datafusion/optimizer/examples so that it is easier to find

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

andygrove and others added 5 commits October 12, 2022 10:12
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@andygrove andygrove merged commit 4cb8ac0 into apache:master Oct 12, 2022
@andygrove andygrove deleted the optimizer-docs branch October 12, 2022 20:10
@ursabot
Copy link

ursabot commented Oct 12, 2022

Benchmark runs are scheduled for baseline = a226587 and contender = 4cb8ac0. 4cb8ac0 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

@alamb
Copy link
Contributor

alamb commented Oct 12, 2022

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants