Skip to content

Add to_unoptimized_plan - #3344

Merged
andygrove merged 3 commits into
apache:masterfrom
iajoiner:issue-3340
Sep 2, 2022
Merged

Add to_unoptimized_plan#3344
andygrove merged 3 commits into
apache:masterfrom
iajoiner:issue-3340

Conversation

@iajoiner

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

cc @andygrove

@github-actionsgithub-actionsBot added the core Core DataFusion crate label Sep 2, 2022
Comment threaddatafusion/core/src/dataframe.rs Outdated

/// 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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Sure!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@andygroveandygrove left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks @iajoiner!

@iajoineriajoiner changed the title Add to_raw_logical_planAdd to_unoptimized_planSep 2, 2022
@codecov-commenter

Copy link
Copy Markdown

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 FilesCoverage Δ
datafusion/core/src/dataframe.rs89.02% <100.00%> (+0.10%)⬆️
datafusion/expr/src/logical_plan/plan.rs78.22% <0.00%> (ø)
datafusion/core/src/physical_plan/metrics/value.rs87.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:masterSep 2, 2022
@ursabot

Copy link
Copy Markdown

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/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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coreCore 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

@iajoiner@codecov-commenter@ursabot@andygrove@chloeandmargaret