cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how to create catalog

PraveenReddy21
New Contributor III

Hi ,

I am trying to create  catalog  and database  its not  allowing  databricks  , please  suggest  .

Here my code .

base_dir = "/mnt/files"
spark.sql(f"CREATE CATALOG IF NOT EXISTS dev")
spark.sql(f"CREATE DATABASE IF NOT EXISTS dev.demo_db")
 
first i need to create  catalog then after  under catalog  i want to create database.
 
Thank You .
Praveen.

 

2 REPLIES 2

szymon_dybczak
Contributor III

Hi @PraveenReddy21 ,

What error do you get? Do you use Unity Catalog or Hive metastore?

Hi ,

Please  find the below  error

AnalysisException: [RequestId=2e102048-fdde-4293-8cfe-8f0d866e5a1c ErrorClass=INVALID_STATE] Metastore storage root URL does not exist. Please provide a storage location for the catalog (for example 'CREATE CATALOG myCatalog MANAGED LOCATION '<location-path>'). Alternatively set up a metastore root storage location to provide a storage location for all catalogs in the metastore.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group