CacheManager is an in-memory cache for cached tables (as logical plans). It uses the internal cachedData collection of CachedData to track logical plans and their cached InMemoryRelation representation.
cacheQuery( query: Dataset[_], tableName: Option[String] = None, storageLevel: StorageLevel = MEMORY_AND_DISK): Unit
If however the query has already been cached, you should instead see the following WARN message in the logs:
WARN CacheManager: Asked to cache already cached data.
clearCache acquires a write lock and unpersists
RDD[CachedBatch]s of the queries in cachedData before removing them altogether.