clearCacheΒΆ

clearCache removes all cached Spark SQL tables from the in-memory cache.

Syntax:

  • clearCache()

Parameters:

Output:

  • NULL
require(SparkR)

# Create SparkDataFrame using the faithful dataset from R
df <- createDataFrame(faithful)

# Register df as Temporary Table, with table name: tempTable
registerTempTable(df, "tempTable")

# Cache Spark SQL table in memory
cacheTable("tempTable")
# Clear all cached tables in the current session
clearCache()