You may call
val rdds = sparkContext.getPersistentRDDs(); // result is Map[Int, RDD]
and then filter the values to get that value you want (1):
rdds.filter (x => filterLogic(x._2)).foreach (x => x._2.unpersist())
(1) - written by hand, without a compiler - sorry if there is any error, but it should not be;)
source
share