cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to list all Delta tables in a Database?

User16869510359
Esteemed Contributor

I wanted to get a list of all the Delta tables in a Database. What is the easiest way of getting it.

1 ACCEPTED SOLUTION

Accepted Solutions

User16869510359
Esteemed Contributor

Below code, the snippet can be used to list down the tables in a database

val db = "database_name"
 
spark.sessionState.catalog.listTables(db).map(table=>spark.sessionState.catalog.externalCatalog.getTable(table.database.get,table.table)).filter(x=>x.provider.toString().toLowerCase.contains("delta"))

View solution in original post

1 REPLY 1

User16869510359
Esteemed Contributor

Below code, the snippet can be used to list down the tables in a database

val db = "database_name"
 
spark.sessionState.catalog.listTables(db).map(table=>spark.sessionState.catalog.externalCatalog.getTable(table.database.get,table.table)).filter(x=>x.provider.toString().toLowerCase.contains("delta"))

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.