ueshin commented on code in PR #45378:
URL: https://github.com/apache/spark/pull/45378#discussion_r1513759920
##########
python/pyspark/sql/profiler.py:
##########
@@ -224,6 +224,54 @@ def dump(id: int) -> None:
for id in sorted(code_map.keys()):
dump(id)
+ def clear_perf_profiles(self, id: Optional[int] = None) -> None:
+ """
+ Clear the perf profile results.
+
+ .. versionadded:: 4.0.0
+
+ Parameters
+ ----------
+ id : int, optional
+ The UDF ID whose profiling results should be cleared.
+ If not specified, all the results will be cleared.
+ """
+ ids_to_remove = [
+ result_id
+ for result_id, (perf, _, *_) in self._profile_results.items()
+ if perf is not None
+ ]
+ with self._lock:
+ if id is not None:
+ if id in ids_to_remove:
+ self._profile_results.pop(id, None)
Review Comment:
Seems to be removing `memory` as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]