filipniziol
Esteemed Contributor

Hi @n_joy ,
what is your limitation here?
You cannot run the statement mentioned in the error message?

 

ALTER TABLE table_name 
SET TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported')

 

Do I understand correctly that the table is created, you do not have permissions to run ALTER statement, so you want to somehow change this property with steaming query?

If yes, it is not possible.

Streaming queries that insert data are DML (Data Manipulation Language) statements, which are used to modify the data within the table (e.g., INSERT, UPDATE).

ALTER statements are DDL (Data Definition Language) statements, which are used to modify the structure or properties of the table itself.

DML and DDL statements cannot be mixed in a streaming query. This is a fundamental limitation in SQL operations, meaning you cannot modify table properties while performing data insertions through streaming.

Additionally, even creating a table with DEFAULT without 'delta.feature.allowColumnDefaults' property fails.

filipniziol_0-1725520518981.png

To sum up, the only way to make it work is to run the ALTER command and set 'delta.feature.allowColumnDefaults' = 'supported'.