Error Creating Table from delta location dbfs
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 12:16 AM - edited 11-06-2024 12:20 AM
[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)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 08:18 AM
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

