NandiniN
Databricks Employee
Databricks Employee

Hello @Mattias P​ ,

In your statement above, the create table command should contain the defaults,

but when I tried it, it failed saying defaults are not allowed.

Initially this was not supported with Delta, but when this feature was introduced in Delta protocol we had to add it in TBLPROPERTIES. Note - this is only for Delta, other protocol works without any TBLPROPERTIES. The doc will be updated to reflect this.

CREATE TABLE Table (

col1 string NOT NULL DEFAULT 'abc'

)

USING Delta

TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported')

Hope this helps.

Thanks & Regards,

Nandini