Hi @Ramanathan Murugan Veerabagu
It looks like you're running into a Unity Catalog restriction. In Unity Catalog, CREATE SCHEMA
(or CREATE DATABASE
) must use a MANAGED LOCATION instead of a custom LOCATION
.
Here’s what you can try:
- Check if your metastore has a managed location set – You can only create schemas in Unity Catalog with a managed location.
- Use
MANAGED LOCATION
instead ofLOCATION
– The correct syntax should be:CREATE DATABASE IF NOT EXISTS <DB_Name> MANAGED LOCATION "abfss://<container>@<storage_account>.dfs.core.windows.net/<path>/"
- Confirm your cluster is using Unity Catalog – If it worked in one notebook but not another, check if the cluster is configured for Unity Catalog.
Since it worked yesterday but not today, there might have been a change in your workspace setup. You can also try running SHOW DATABASES
to check if the database exists in Unity Catalog.
Let me know if this helps!