Applies to:
Databricks SQL
Databricks Runtime 13.3 LTS and above
Unity Catalog only
Refreshes the metadata maintained in Unity Catalog for a:
- Foreign catalog and its securables,
- Foreign schema and its securables, or
- Foreign table.
To run REFRESH FOREIGN CATALOG
, you need at least one of the following:
- Be a metastore admin
- Have the
USE CATALOG
privilege on the catalog, the USE SCHEMA
privilege on all child schemas, and the SELECT
privilege on all child tables
To run REFRESH FOREIGN SCHEMA
, you need at least one of the following:
- Be metastore admin
- Be the owner of the parent catalog
- Have
MANAGE
and USE SCHEMA
privileges on the schema and USE CATALOG
on the parent catalog
- Have the
USE CATALOG
privilege on the parent catalog, the USE SCHEMA
privilege on the schema, and the SELECT
privilege on all child tables
To execute REFRESH FOREIGN TABLE
you need at least one of the following:
- Be metastore admin
- Be the owner of the parent catalog
- Be the owner of the parent schema and have the
USE CATALOG
privilege on the parent catalog
- Have
MANAGE
and USE SCHEMA
privileges on the parent schema and USE CATALOG
on the parent catalog
- Have
USE CATALOG
and USE SCHEMA
privileges on the parent catalog and schema, respectively, and the SELECT
privilege on the table
To execute the optional RESOLVE DBFS LOCATION
clause to update the resolved DBFS location of a Hive metastore federated table, you need at least one of the following:
- Be the table owner.
- Have the
MANAGE
privilege on the table, along with USE SCHEMA
on the schema and USE CATALOG
on the parent catalog
REFRESH FOREIGN
{ CATALOG foreign_catalog_name |
SCHEMA foreign_schema_name |
TABLE foreign_table_name [RESOLVE DBFS LOCATION] }
> REFRESH FOREIGN CATALOG some_catalog;
> REFRESH FOREIGN SCHEMA some_catalog.some_schema;
> REFRESH FOREIGN TABLE some_catalog.some_schema.some_table;
—- Resolves the DBFS location of the foreign table and updates it in Unity Catalog.
> REFRESH FOREIGN TABLE hms_fed_catalog.schema.table RESOLVE DBFS LOCATION;