Github user wesolowskim commented on the issue: https://github.com/apache/spark/pull/14137 I agree it is possible however quite hard in this case. You loose reference to workGraph few times before materialization occurs, and then few graphs get materialized at the same time. Testing is also troublesome, because you have to actually check if something didn't get unpersisted too early and that requires big graph (and long running program) or sophisticated code to check it. I pushed my last commit that corrects mistakes you pointed out and additionally removes some cache() that was superfluous.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org