[SPARK-53972][SS] Fix streaming query recentProgress regression in classic pyspark #52688
+5
−2
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?
We found a performance regression in recentProgress in pyspark in assigned cluster after version 4.0. The direct cause of the regression in this commit, it changes how we load recentProgress
fromJsontofromJObject, and this commit is only included in 4.0. However, when constructing a dict fromJObject, py4j needs to make multiple RPCs to JVM which result in a long timeProposed Fix:
Use fromJson to load StraemingQueryProgress instead. This will be aligned with the recentProgress in pyConnect as well
We are also fixing
lastProgressto load StreamingQueryProgress from json.Why are the changes needed?
Otherwise there is a performance regression in recentProgress. Here is the log of the time it takes to load 70 recent progress:
This is generated by adding the following test to test_streaming.py locally
Does this PR introduce any user-facing change?
No
How was this patch tested?
Run local script with the changes and here is the output log.
Was this patch authored or co-authored using generative AI tooling?
No