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

How nulls are stored in delta lake and databricks?

DB_developer
New Contributor III

In my findings I have found a lot of delta tables in the lake house to be sparse so just wondering what space data lake takes to store null data and also any suggestions to handle sparse data tables in lake house would be appreciated.

I also want to optimize this sparse data at processing layer as well. We use databricks for our ETL operations. So, Can you also let me know how nulls are stored in databricks as well?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

As delta uses parquet files to store data inside delta:

"Nullity is encoded in the definition levels (which is run-length encoded). NULL values are not encoded in the data. For example, in a non-nested schema, a column with 1000 NULLs would be encoded with run-length encoding (0, 1000 times) for the definition levels and nothing else."

source: https://parquet.apache.org/docs/file-format/nulls/

View solution in original post

4 REPLIES 4

Ajay-Pandey
Esteemed Contributor III

Hi @Akash Ragothu​ please refer this link it might help you with that.

Hubert-Dudek
Esteemed Contributor III

As delta uses parquet files to store data inside delta:

"Nullity is encoded in the definition levels (which is run-length encoded). NULL values are not encoded in the data. For example, in a non-nested schema, a column with 1000 NULLs would be encoded with run-length encoding (0, 1000 times) for the definition levels and nothing else."

source: https://parquet.apache.org/docs/file-format/nulls/

That is useful info. Thanks! Can you also please let me know how many bytes of storage would a null value take in lakehouse?​

Kaniz
Community Manager
Community Manager

Hi @Akash Ragothu​, We haven’t heard from you since the last response from @Ajay Pandey​, and I was checking back to see if his suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

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.