-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54749][SQL] Fix incorrect numOutputRows metric in OneRowRelationExec #53520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
Contributor
Author
|
the bug was introduced in #50849 |
Contributor
Author
Contributor
Author
|
Also cc @pan3793 for finding this bug while adding Spark 4.1.0 support for Kyuubi in apache/kyuubi#7254 . |
pan3793
approved these changes
Dec 18, 2025
Member
pan3793
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @cfmcgrady, thanks for fixing it quickly!
cloud-fan
reviewed
Dec 18, 2025
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
Outdated
Show resolved
Hide resolved
cloud-fan
approved these changes
Dec 18, 2025
Contributor
|
the pyspark failure is unrelated, thanks, merging to master/4.1! |
cloud-fan
pushed a commit
that referenced
this pull request
Dec 18, 2025
…onExec ### What changes were proposed in this pull request? This PR moves the `numOutputRows` metric update logic from the val rdd initialization block to the `doExecute()` method in `OneRowRelationExec`. ### Why are the changes needed? Currently, the `numOutputRows` metric in `OneRowRelationExec` is incorrectly incremented twice in the codegen codebase (displaying 2 instead of 1 for a single row). before this PR: <img width="251" height="318" alt="企业微信截图_70a269d7-7e34-40a4-a0f4-abeae7283a79" src="https://github.com/user-attachments/assets/4a376f45-e89d-4fa6-8ba9-a564663467cf" /> after this PR: <img width="242" height="314" alt="企业微信截图_d7fab096-024e-440b-94e1-707296258c55" src="https://github.com/user-attachments/assets/036de957-9ba9-4b7d-a89e-ed737d23eae2" /> ### Does this PR introduce _any_ user-facing change? No, only bug fix. ### How was this patch tested? Added UT. ### Was this patch authored or co-authored using generative AI tooling? Closes #53520 from cfmcgrady/fix-onerowrelation-metrics. Authored-by: Fu Chen <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit a26c209) Signed-off-by: Wenchen Fan <[email protected]>
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.
What changes were proposed in this pull request?
This PR moves the
numOutputRowsmetric update logic from the val rdd initialization block to thedoExecute()method inOneRowRelationExec.Why are the changes needed?
Currently, the
numOutputRowsmetric inOneRowRelationExecis incorrectly incremented twice in the codegen codebase (displaying 2 instead of 1 for a single row).before this PR:
after this PR:
Does this PR introduce any user-facing change?
No, only bug fix.
How was this patch tested?
Added UT.
Was this patch authored or co-authored using generative AI tooling?