Fix elapsed_compute metric for Parquet DataSourceExec#20767
Open
ernestprovo23 wants to merge 1 commit intoapache:mainfrom
Open
Fix elapsed_compute metric for Parquet DataSourceExec#20767ernestprovo23 wants to merge 1 commit intoapache:mainfrom
elapsed_compute metric for Parquet DataSourceExec#20767ernestprovo23 wants to merge 1 commit intoapache:mainfrom
Conversation
The `elapsed_compute` baseline metric for Parquet scans previously reported unrealistically low values (e.g. 14ns for a full table scan) because no timer was wrapping the per-batch compute work. This follows the same pattern used in PR apache#18901 for CSV: instantiate `BaselineMetrics` in `ParquetOpener::open()` and wrap the stream's per-batch processing (projection, schema replacement, metrics copy) with an `elapsed_compute` timer. Closes part of apache#18195.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes part of #18195 — specifically the
elapsed_computebaseline metric sub-item for Parquet scans.Rationale
EXPLAIN ANALYZEon Parquet scans reportselapsed_computevalues like14nsfor full table scans, which is misleading. The metric was never being populated because no timer wrapped the per-batch compute work in the Parquet scan path.What changes are included in this PR?
Follows the same pattern established in PR #18901 (CSV fix):
BaselineMetricsinstantiation inParquetOpener::open()using the existingmetricsandpartition_indexfields.map()closure with anelapsed_computetimer that measures projection, schema replacement, and metrics copy workSingle file changed:
datafusion/datasource-parquet/src/opener.rs(+7, -3 lines)Are these changes tested?
datafusion-datasource-parquetpasselapsed_computevalues inEXPLAIN ANALYZEoutput (no longer showing nanosecond-level values for real scans)Are there any user-facing changes?
EXPLAIN ANALYZEoutput for Parquet scans will now show accurateelapsed_computevalues reflecting actual CPU time spent on per-batch processing.