dataframe用.cache()或者.persist()进行缓存

1、df.cache()等同于df.persist()或df.persist(storageLevel=pyspark.StorageLevel.MEMORY_AND_DISK)

table用.catalog.cacheTable进行缓存