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: 

Data Types - varchar(2147483647)

yumnus
New Contributor III

Hi,

when I read a PostgreSQL table containing a custom datatype, it gets translated to VARCHAR(2147483647).

I would like to understand how Databricks and Delta handle this scenario. Specifically, does Delta store all the bytes for the maximum length of 2147483647 characters, or does it only store the bytes for the actual characters used?

For example, if I use only 1000 characters instead of the full capacity, does Delta still allocate storage for the entire 2147483647 characters?

Thank you and best regards

1 ACCEPTED SOLUTION

Accepted Solutions

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @yumnus,

Delta does not allocate storage for the entire length (2147483647) characters if you only use a portion of it. Instead, Delta stores only the bytes for the actual characters used. 

View solution in original post

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @yumnus,

Delta does not allocate storage for the entire length (2147483647) characters if you only use a portion of it. Instead, Delta stores only the bytes for the actual characters used. 

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