cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Find the size of delta table for each month before partition

chandraprakash
New Contributor

We have 38 delta tables. We decided to do partition the delta tables for each month.

But we have some small tables as well. So we need find the size of delta tables for each month. So that we can use either partition or Z-order

Is there a way to find the size of delta table for each month?

2 REPLIES 2

Lakshay
Databricks Employee
Databricks Employee

I think the only option here is to run a count by the partition column. That will give you the no. of rows for each partition.

dennyglee
Databricks Employee
Databricks Employee

For your tables, Iโ€™m curious if you could utilize Liquid Clustering to reduce some of the maintenance issues relating to choosing Z-Order vs. partitioning.  

Saying this, one potential way is to read the Delta transaction log and read the Add Info statistics which includes the file path and size.  

You can query the transaction log add info directly to extract out all the files that are associated with a particular month to calculate its size.  

You can also find more info about this at A peek into the Delta Lake Transaction Log.  

HTH!

 

Connect with Databricks Users in Your Area

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