cancel
Showing results for 
Search instead for 
Did you mean: 
Summit 2024
Stay tuned for all the latest updates, insights, and highlights from the premier event in Databricks Data and AI Summit 2024.
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating table in Unity Catalog with file scheme dbfs is not supported.

shiva123
New Contributor

Creating table in Unity Catalog with file scheme dbfs is not supported.

Instead, please create a federated data source connection using the CREATE CONNECTION command for the same table provider, then create a catalog based on the connection with a CREATE FOREIGN CATALOG command to reference the tables therein. I am getting this error . I am trying to create a table in Databricks workspace. I don't know How to create a connection for data which is residing in delta lake(s3) . Anyone can give me a code to create a connection and foreign catalog in databricks notebook .Here is my code. 

staging_table_path="dbfs:/user/hive/warehouse/staging_order_tracking"
spark.sql(f"create table if not exists staging_order_tracking using delta location '{staging_table_path}'")

 

 

1 REPLY 1

daniel_sahal
Esteemed Contributor

@shiva123 
As the error says, you cannot create a table with DBFS as location.
If you really need to create external table, please follow this guide: https://learn.microsoft.com/en-us/azure/databricks/tables/external