fix: report native shuffle read metrics - #5554
Conversation
|
I'm on it today, thanks @peterxcli |
comphead
left a comment
There was a problem hiding this comment.
Thanks @peterxcli would you mind to attach a screenshot on what is changed? SparkUI shows currently records from shuffle read stages, just wondering what part of metrics is addressed
|
@comphead updated the screenshot to show the parquet scan result in ui against before/after patch, please take another look, thanks! |
|
Thanks @peterxcli for the test, I believe it might have sense to compare against Spark metrics. The same way is done for the input scan metrics. |
|
@comphead
looks like they have different shuffle read byte but I think it's because Spark uses row/serializer shuffle data; Comet uses compressed Arrow IPC, so identical bytes are neither expected nor desirable. Spark itself derives this counter from each fetched buffer’s physical size (Spark source) |
|
rows should be the same so we can check it with Spark metrics, bytes can be checked it is the same ballpark. Please check input scan metrics test, the approach was adopted there |
|
@comphead thanks for the direction, added test to check # of rows |
comphead
left a comment
There was a problem hiding this comment.
Thanks @peterxcli
CI pending


Which issue does this PR close?
Part of #3996.
Rationale for this change
The direct native shuffle-read path bypasses Spark's normal decode path, so its records-read metric was not updated and temporary shuffle-read metrics were not merged into task metrics. This left the Spark Stage and SQL UIs with missing or zero native shuffle-read values.
What changes are included in this PR?
CometShuffleBlockIterator.ShuffleScanpath, assert SQL/Stages UI aggregates, and preserve metrics on failed attempts.How are these changes tested?
cargo buildcargo fmt --all -- --check./mvnw test -Dtest=none -Dsuites='org.apache.spark.sql.comet.CometTaskMetricsSuite native shuffle read' -Dscalastyle.skip=true(2 tests)ShuffleScanExecShuffle Read Size / Records: 2004.6 KiB / 500000before: (shuffle read didn't appear)

after: