Databricks - How to check if a delta table exists or not (using table identifier, NOT path )

414 views Asked by At

Is there any delta methods or attributes (In Python/Scala APIs) that are helpful in finding out if a given table name is present in a given schema or not?

I came across this method isDeltaTable() of this class delta.tables.DeltaTable, which will return true if the provided table path is a delta table and false if it is not a delta table. But, is there any other method that accepts identifier(table name) instead of table path, since in UC catalog, the table are managed internally by databricks (and we can't always provide the exact path of managed tables).

1

There are 1 answers

0
luis.villazon On

Try DeltaTable.forName(). According to the documentation it receives as parameter the name of the table or view.