cache和persist都是用于将一个RDD进行缓存的,这样在之后使用的过程中就不需要重新计算了,可以大大节省程序运行时间. cache和persist的区别 基于Spark 1.6.1 的源码,可以看到 /** Persist this RDD with the default storage level (`MEMORY_ONLY`). */ def cache(): this.type = persist() 说明是cache()调用了persist(), 想要知道二者的不同还需要看一下…