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

What is the difference between spark.sessionState.catalog.listTables vs spark.catalog.listTables

User16869510359
Esteemed Contributor

I see a significant performance difference when calling spark.sessionState.catalog.list compared to spark.catalog.list. Is that expected?

1 ACCEPTED SOLUTION

Accepted Solutions

User16869510359
Esteemed Contributor

spark.sessionState.catalog.listTables is a more lazy implementation.. it does not pull the column details when listing the tables. Hence it's faster. Whereas catalog.listTables will pull the column details as well.

If the database has many Delta tables, it's possible getting the column details will take a long time, whereas just getting the metadata should be faster.

View solution in original post

1 REPLY 1

User16869510359
Esteemed Contributor

spark.sessionState.catalog.listTables is a more lazy implementation.. it does not pull the column details when listing the tables. Hence it's faster. Whereas catalog.listTables will pull the column details as well.

If the database has many Delta tables, it's possible getting the column details will take a long time, whereas just getting the metadata should be faster.

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.