To remove all cached data:
sqlContext.clearCache()
Source: https://spark.apache.org/docs/2.0.1/api/java/org/apache/spark/sql/SQLContext.html
If you want to remove an specific Dataframe from cache:
df.unpersist()
To remove all cached data:
sqlContext.clearCache()
Source: https://spark.apache.org/docs/2.0.1/api/java/org/apache/spark/sql/SQLContext.html
If you want to remove an specific Dataframe from cache:
df.unpersist()