cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error not a delta table for Unity Catalog table

Stogpon
New Contributor III

Is anyone able to advise why I am getting the error not a delta table?  The table was created in Unity Catalog.  I've also tried DeltaTable.forName and also using 13.3 LTS and 14.3 LTS clusters. Any advice would be much appreciatedScreenshot 2024-03-18 at 12.10.30 PM.png

 

Screenshot 2024-03-18 at 12.14.24 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions

addy
New Contributor III

@StogponI believe if you are using DeltaTable.forPath then you have to pass the path where the table is. You can get this path from the Catalog. It is available in the details tab of the table.

Example:
delta_table_path = "dbfs:/user/hive/warehouse/xyz"

# Read the Delta table using forPath
deltaTable = DeltaTable.forPath(spark, delta_table_path)

The other way would be to use would be DeltaTable.forName(spark, 'tablename')

Hopefully this helps.

View solution in original post

4 REPLIES 4

Kaniz_Fatma
Community Manager
Community Manager

Hi @Stogpon, Could you please paste the error stack here?

 

Stogpon
New Contributor III

@Kaniz_Fatma the attached screen was using 14.3 LTS cluster.  ThanksScreenshot 2024-03-18 at 7.51.14 PM.png

addy
New Contributor III

@StogponI believe if you are using DeltaTable.forPath then you have to pass the path where the table is. You can get this path from the Catalog. It is available in the details tab of the table.

Example:
delta_table_path = "dbfs:/user/hive/warehouse/xyz"

# Read the Delta table using forPath
deltaTable = DeltaTable.forPath(spark, delta_table_path)

The other way would be to use would be DeltaTable.forName(spark, 'tablename')

Hopefully this helps.

Stogpon
New Contributor III

@addy thanks for your reply.  I tried with forName and it's now working.  I had tried this both forName and forPath previously with the same error so I'm not sure why it's working now.  I can't recall what has changed since whilst I was experimenting/diagnosing.  If I experience it again I'll have to take closer notes of the steps I took to reach that step.  Anyhow thanks for your help, it's much appreciated.   

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!