03-17-2024 09:17 PM
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 appreciated
03-19-2024 07:51 AM - edited 03-19-2024 07:52 AM
@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.
03-18-2024 04:52 AM
@Retired_mod the attached screen was using 14.3 LTS cluster. Thanks
03-19-2024 07:51 AM - edited 03-19-2024 07:52 AM
@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.
03-19-2024 08:22 AM
@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 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