Error Creating Table from delta location dbfs

vyasakhilesh
New Contributor
[UC_FILE_SCHEME_FOR_TABLE_CREATION_NOT_SUPPORTED] 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. SQLSTATE: 0AKUC
File <command-1426791046668810>, line 2 1 spark.sql("CREATE DATABASE IF NOT EXISTS AdventureWorks") ----> 2 spark.sql(f"""CREATE TABLE AdventureWorks.ProductsExternal 3 ( ProductID INT, 4 ProductName STRING, 5 Category STRING, 6 ListPrice FLOAT) 7 USING DELTA LOCATION 'dbfs:/{0}'""".format(delta_table_path)) 8 spark.sql("DESCRIBE EXTENDED AdventureWorks.ProductsExternal").show(truncate=False)

agallard2
New Contributor III

Hi @vyasakhilesh,

The error you're seeing, [UC_FILE_SCHEME_FOR_TABLE_CREATION_NOT_SUPPORTED], occurs because Unity Catalog in Databricks does not support creating tables directly from DBFS (Databricks File System) locations.

In this case, you're trying to create a table in Unity Catalog using a DBFS path with USING DELTA LOCATION 'dbfs:/...', which Unity Catalog does not support.

Regards!


-------------------

Alfonso Gallardo