- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 06:39 AM
Databricks support string data type. But I can still create delta table with varchar data type. Just wonder what is different between delta table with string and delta table with varchar:
-- delta table with string
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 05:44 AM
VARCHAR allows you to specify the size of the string expected in the column.
This is useful when you know your column cannot exceed a set size (ie for a name, a code etc).
It is equivalent to a CHECK contraint on the size. Trying to insert a value that exceeds the size given results in the following error :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 05:44 AM
VARCHAR allows you to specify the size of the string expected in the column.
This is useful when you know your column cannot exceed a set size (ie for a name, a code etc).
It is equivalent to a CHECK contraint on the size. Trying to insert a value that exceeds the size given results in the following error :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 05:55 AM
Thanks for the precision @erigaud !

