fix: expose PartitionedTopKExec metrics - #24495
Open
shinzoxD wants to merge 1 commit into
Open
Conversation
Contributor
|
how does this differ from |
Contributor
|
for anyone looking at this PR please see my comment here: |
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?
metrics()returnsNone) #24470Rationale for this change
PartitionedTopKExecalready collectedExecutionPlanMetricsSetinternally, butExecutionPlan::metrics()was unimplemented so it returnedNone.EXPLAIN ANALYZEtherefore showed no metrics, andoutput_rows/output_batchescould not be checked against what the operator actually emits.What changes are included in this PR?
PartitionedTopKExec::metrics()so it returns the existing metrics set, matchingSortExec/ window operators.output_rows,output_batches,output_bytes) on the coalesced batches sent to the consumer, not on the pre-coalesce per-partition heap batches.elapsed_computewas already tracked viaTopKMetrics.This does not address #24468 (
SortExecTopKoutput_batches).Are these changes tested?
Added the issue's reproduction as
partitioned_topk_output_batches_metric_matches_emitted_batches: it assertsmetrics()isSomeand thatoutput_batchesequals the number of batches actually emitted (5 coalesced batches of 10 rows).Also ran:
cargo test -p datafusion-physical-plan --lib topk(82 passed)cargo test -p datafusion --test core_integration partitioned_topk_output_batches_metric_matches_emitted_batches(passed)cargo fmt --allcargo clippy -p datafusion-physical-plan --all-targets --all-features -- -D warningscargo clippy -p datafusion --test core_integration -- -D warningsAre there any user-facing changes?
EXPLAIN ANALYZEnow reports metrics forPartitionedTopKExec(output_rows,output_batches,elapsed_compute, etc.).