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: 

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

3 REPLIES 3

Ajay-Pandey
Esteemed Contributor III

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

Ajay Kumar Pandey

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?​

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