Spark SQL可以通过spark.catalog.cacheTable("tableName") 或dataFrame.cache() 缓存数据;
spark.catalog.cacheTable("tableName")
dataFrame.cache()
通过spark.catalog.uncacheTable("tableName") 将数据从缓存清除。
spark.catalog.uncacheTable("tableName")