Skip to content

Conversation

@DaltonModlin
Copy link
Contributor

  • tpch.rs::benchmark_datafusion now executes LogicalPlan immediately after building
  • tpch.rs::run_query now executes LogicalPlan immediately after building

Resolves #3273

Which issue does this PR close?

Closes #3273

Rationale for this change

In the case of TPCH Query 15, a LogicalPlan is created for the first part of the query (creating the view), but a LogicalPlan for the second part of the query cannot be constructed before executing the first LogicalPlan. This is because the view cannot be found in the session context until its LogicalPlan is executed.

What changes are included in this PR?

Update tpch.rs to generate a LogicalPlan, and then immediately execute it before generating the next LogicalPlan for both tpch.rs::benchmark_datafusion and tpch.rs::run_query

Are there any user-facing changes?

No.

- tpch.rs::benchmark_datafusion now executes LogicalPlan immediately after building
- tpch.rs::run_query now executes LogicalPlan immediately after building

Resolves #3273
@DaltonModlin
Copy link
Contributor Author

@andygrove @mingmwang Would one of you mind giving this a quick look? If we want to keep the output defined in the execute_query method, I could also rewrite the logic defined in create_logical_plans to create plans one at a time. Otherwise, I
believe the create_logical_plans method and execute_query methods can both be removed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2022

Codecov Report

Merging #3290 (1f83b90) into master (7aed4d6) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #3290      +/-   ##
==========================================
- Coverage   85.92%   85.92%   -0.01%     
==========================================
  Files         294      294              
  Lines       53469    53467       -2     
==========================================
- Hits        45945    45943       -2     
  Misses       7524     7524              
Impacted Files Coverage Δ
benchmarks/src/bin/tpch.rs 41.15% <66.66%> (-0.25%) ⬇️
datafusion/expr/src/expr_schema.rs 68.91% <0.00%> (-0.68%) ⬇️
datafusion/expr/src/logical_plan/plan.rs 78.73% <0.00%> (ø)
datafusion/expr/src/window_frame.rs 93.27% <0.00%> (+0.84%) ⬆️

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

- Updated execute_query to accept sql string instead of LogicalPlan as second argument
- Updated tpch.rs::run_query to use tpch.rs::execute_query
- Updated tpch.rs::benchmark_datafusion to use tpch.rs::execute_query
- Removed unused include of LogicalPlan module in tpch.rs
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 @DaltonModlin

@andygrove andygrove merged commit 3effee8 into apache:master Aug 30, 2022
@ursabot
Copy link

ursabot commented Aug 30, 2022

Benchmark runs are scheduled for baseline = 7aed4d6 and contender = 3effee8. 3effee8 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 Aug 31, 2022

This is a nice solution -- thanks @DaltonModlin

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.

Execute LogicalPlans after building for TPCH Benchmarks

5 participants