REFRESH TABLE
Applies to: Databricks Runtime
Invalidates the cached entries for Apache Spark cache, which include data and metadata of the given table or view. The invalidated cache is populated in lazy manner when the cached table or the query associated with it is executed again.
Syntax
REFRESH [TABLE] table_name
See Disk cache vs. Spark cache for the differences between disk caching and the Apache Spark cache.
Parameters
-
Identifies the Delta table or view to cache. The name must not include a temporal specification or options specification. If the table cannot be found Databricks raises a TABLE_OR_VIEW_NOT_FOUND error.
Examples
-- The cached entries of the table is refreshed
-- The table is resolved from the current schema as the table name is unqualified.
> REFRESH TABLE tbl1;
-- The cached entries of the view is refreshed or invalidated
-- The view is resolved from tempDB schema, as the view name is qualified.
> REFRESH TABLE tempDB.view1;