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

Add to_unoptimized_plan #3344

Merged
merged 3 commits into from
Sep 2, 2022
Merged

Add to_unoptimized_plan #3344

merged 3 commits into from
Sep 2, 2022

Conversation

iajoiner
Copy link
Contributor

@iajoiner iajoiner commented Sep 2, 2022

Which issue does this PR close?

Closes #3340.

Rationale for this change

Enable people to fetch the raw LogicalPlan in a DataFrame.

What changes are included in this PR?

pub fn to_raw_logical_plan(&self) -> LogicalPlan {..} has been added together with an assertion in a test.

Are there any user-facing changes?

Yes. There are no breaking changes though.

@iajoiner
Copy link
Contributor Author

iajoiner commented Sep 2, 2022

cc @andygrove

@github-actions github-actions bot added the core Core DataFusion crate label Sep 2, 2022
@@ -520,7 +520,13 @@ impl DataFrame {
self.plan.schema()
}

/// Return the logical plan represented by this DataFrame.
/// Return the raw (i.e. unoptimized) logical plan represented by this DataFrame.
pub fn to_raw_logical_plan(&self) -> LogicalPlan {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if a better name would be to_unoptimized_plan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Do we need to specify that it is a logical as opposed to physical plan in the name?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so, because the return type is LogicalPlan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andygrove Done!

Copy link
Member

@andygrove andygrove 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 @iajoiner!

@iajoiner iajoiner changed the title Add to_raw_logical_plan Add to_unoptimized_plan Sep 2, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #3344 (dc03f40) into master (24db13b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3344   +/-   ##
=======================================
  Coverage   85.49%   85.50%           
=======================================
  Files         294      294           
  Lines       54060    54064    +4     
=======================================
+ Hits        46220    46225    +5     
+ Misses       7840     7839    -1     
Impacted Files Coverage Δ
datafusion/core/src/dataframe.rs 89.02% <100.00%> (+0.10%) ⬆️
datafusion/expr/src/logical_plan/plan.rs 78.22% <0.00%> (ø)
datafusion/core/src/physical_plan/metrics/value.rs 87.43% <0.00%> (+0.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andygrove andygrove merged commit 5bdd55b into apache:master Sep 2, 2022
@ursabot
Copy link

ursabot commented Sep 2, 2022

Benchmark runs are scheduled for baseline = 24db13b and contender = 5bdd55b. 5bdd55b 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

kmitchener pushed a commit to kmitchener/arrow-datafusion that referenced this pull request Sep 4, 2022
* Add to_raw_logical_plan

* rename the new func

* change func name to to_unoptimized_plan
@iajoiner iajoiner deleted the issue-3340 branch September 11, 2022 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to get unoptimized logical plan from DataFrame
5 participants