メインコンテンツまでスキップ

SET MANAGED (FOREIGN VIEW)

Applies to: check marked yes Databricks Runtime 17.3 and above

Preview

This feature is in Public Preview and is only available to participating customers at this time. To participate in the preview, apply by filling out this form. This feature only supports converting foreign views federated using HMS and Glue Federation.

Use the ALTER VIEW SET MANAGED command to convert a foreign view to a standard view in Unity Catalog. After conversion, the view stops syncing with the external catalog's view definition.

To roll back the view to a foreign view, drop the view. It is then re-federated into the foreign catalog as a foreign view during the next catalog sync.

During conversion, the command validates that the SQL text of the view definition is valid and that referenced tables exist in the foreign catalog.

Requires OWNER or MANAGE permissions on the view and the catalog.

Syntax

SQL
ALTER VIEW view_name SET MANAGED

Parameters

  • view_name

    The name of the foreign view to convert to a standard view.

Examples

SQL
-- Convert a foreign view to a standard view
> ALTER VIEW hms_federated_catalog.my_schema.my_view SET MANAGED;
OK

You can confirm that your foreign view has been converted to a standard view:

SQL
-- Check the view type after conversion
> DESCRIBE EXTENDED hms_federated_catalog.my_schema.my_view;

If the view has been converted, the Type under col_name shows as VIEW under data_type.