szymon_dybczak
Esteemed Contributor III

Hi @Box_clown ,

To be precise, Delta Lake format is based on parquet files. For strings, Parquet only has one data type: StringType

So, basically varchar(n) data type under the hood is represented as string with check constraint on the length of the string.

So what I think is happening here is when you perform alter of this column you implicitly removes this check constraint and create new one: null constraint. 

Try to add check constraint on the length of this column to your alter statement.

But agree, it's bit weird. It looks like some kind of bug, or at least this behavior should be documented somewhere