You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "nmbr7 (via GitHub)" <gi...@apache.org> on 2025/11/05 01:12:50 UTC
[PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
nmbr7 opened a new pull request, #18491:
URL: https://github.com/apache/datafusion/pull/18491
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
- Closes #17027
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
- Added output_batches into BaselineMetrics
- Tracked through record_poll() API
- Changes are similar to https://github.com/apache/datafusion/pull/18268
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
TODO
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#issuecomment-3502331040
@2010YOUY01, can you give it another go, updated the test and added baseline metrics in `RepartitionExec`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#issuecomment-3501706604
@2010YOUY01, have done the requested changes, do check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#issuecomment-3506531482
@2010YOUY01, it seems that https://github.com/apache/datafusion/pull/18262 will have proper baseline metrics for the `RepartitionExec` with the correct `elapsed_compute` calculation.
Should we remove the basic `RepartitionExec` `BaselineMetrics` I added here (from which we currently use the `output_batches`), or are we okay with having it, since once #18262 is merged, it should be fixed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on code in PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#discussion_r2502612672
##########
datafusion/core/tests/sql/explain_analyze.rs:
##########
@@ -61,12 +61,9 @@ async fn explain_analyze_baseline_metrics() {
assert_metrics!(
&formatted,
"AggregateExec: mode=Partial, gby=[]",
- "metrics=[output_rows=3, elapsed_compute="
- );
- assert_metrics!(
- &formatted,
- "AggregateExec: mode=Partial, gby=[]",
- "output_bytes="
+ "metrics=[output_rows=3, elapsed_compute=",
+ "output_bytes=",
+ "output_batches="
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "2010YOUY01 (via GitHub)" <gi...@apache.org>.
2010YOUY01 merged PR #18491:
URL: https://github.com/apache/datafusion/pull/18491
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#issuecomment-3498044371
Hey @2010YOUY01, please do review once you get time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "2010YOUY01 (via GitHub)" <gi...@apache.org>.
2010YOUY01 commented on code in PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#discussion_r2501609794
##########
datafusion/core/tests/sql/mod.rs:
##########
@@ -40,18 +40,24 @@ use std::io::Write;
use std::path::PathBuf;
use tempfile::TempDir;
-/// A macro to assert that some particular line contains two substrings
+/// A macro to assert that some particular line contains the given substrings
Review Comment:
👍🏼
##########
datafusion/physical-plan/src/metrics/baseline.rs:
##########
@@ -86,6 +89,9 @@ impl BaselineMetrics {
output_bytes: MetricBuilder::new(metrics)
.with_type(super::MetricType::SUMMARY)
.output_bytes(partition),
+ output_batches: MetricBuilder::new(metrics)
+ .with_type(super::MetricType::SUMMARY)
Review Comment:
```suggestion
.with_type(super::MetricType::DEV)
```
Personally I think it is a bit verbose for `summary` level 🤔
##########
datafusion/core/tests/sql/explain_analyze.rs:
##########
@@ -61,12 +61,9 @@ async fn explain_analyze_baseline_metrics() {
assert_metrics!(
&formatted,
"AggregateExec: mode=Partial, gby=[]",
- "metrics=[output_rows=3, elapsed_compute="
- );
- assert_metrics!(
- &formatted,
- "AggregateExec: mode=Partial, gby=[]",
- "output_bytes="
+ "metrics=[output_rows=3, elapsed_compute=",
+ "output_bytes=",
+ "output_batches="
Review Comment:
The output_batches expected value should be stable, let's add it here like `output_batches=1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on code in PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#discussion_r2502616478
##########
datafusion/physical-plan/src/metrics/baseline.rs:
##########
@@ -86,6 +89,9 @@ impl BaselineMetrics {
output_bytes: MetricBuilder::new(metrics)
.with_type(super::MetricType::SUMMARY)
.output_bytes(partition),
+ output_batches: MetricBuilder::new(metrics)
+ .with_type(super::MetricType::SUMMARY)
Review Comment:
Yeah, have updated it to `DEV`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] refactor: include metric output_batches into BaselineMetrics [datafusion]
Posted by "nmbr7 (via GitHub)" <gi...@apache.org>.
nmbr7 commented on PR #18491:
URL: https://github.com/apache/datafusion/pull/18491#issuecomment-3502170579
It seems, with the `force_hash_collisions` feature, the `RepartitionExec` is returning 1 output batch, will update the UT to take the feature flag into account.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org