Question
You have an Azure Databricks workspace that is attached to a Unity Catalog metastore named metastore1. metastore1 contains a catalog named catalog1.
You need to create a new schema named schema2 that meets the following requirements:
- Is contained in catalog1
- Uses abfss://container@storageaccount.dfs.core.windows.net/data as the managed location
Which SQL statement should you execute?
- A. CREATE SCHEMA catalog1.schema2 LOCATION 'abfss://container@storageaccount.dfs.core.windows.net/data';
- B. CREATE SCHEMA catalog1.schema2 MANAGED LOCATION 'abfss://container@storageaccount.dfs.core.windows.net/data'; Correct
- C. CREATE CATALOG schema2 MANAGED LOCATION 'abfss://container@storageaccount.dfs.core.windows.net/data';
- D. CREATE SCHEMA catalog1.schema2 WITH DBPROPERTIES (LOCATION='abfss://container@storageaccount.dfs.core.windows.net/data');
Explanation
In Unity Catalog, a schema's storage root is set with MANAGED LOCATION, and the qualified name catalog1.schema2 places the schema in catalog1. LOCATION is not supported in Unity Catalog; it applies to workspace-level Hive or third-party metastores. CREATE CATALOG would create a catalog named schema2 rather than a schema. WITH DBPROPERTIES only stores key-value properties and does not set the storage location.