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

Get total number of files of a Delta table

erigaud
Honored Contributor

I'm looking to know programatically how many files a delta table is made of.

I know I can do 

%sql
DESCRIBE
DETAIL my_table

But that would only give me the number of files of the current version. I am looking to know the total number of files (basically what I would get If I ran the following command in a terminal in the folder of my table.

> ls *.parquet | wc -l

Is there a way to achieve this ? The end goal is to build a dashboard showing, among other things, the proportion of "old parquet files" compared to the current version for a given table.

1 REPLY 1

erigaud
Honored Contributor

Yes I think that solution is good, thank you !

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.