The unpersist function will trigger two actions: Uncaching dataframe data and re-compile dependent cached queries. When blocking is false, the two actions are asynchronous。So
when the recompiling is in progress and the dataframe cache data to be remove isn`t removed, it will be used by the cached query which is recompiling, then the cached dataframe data won’t be removed.
So it will remove
actual data frame data inside cache in the following case:
the removing is earlier than the recompiling.
the recompiling won’t use the catched dataframe data.
If you want to learn more details, pls see the code: