Change data feed for tables with allowColumnDefaults property "enabled"

n_joy
Contributor

I have a Delta table already created, with both enabled the #enableChangeDataFeed option and #allowColumnDefaults properties. However when writing to CDC table with streaming queries it fails with the following error [CREATE TABLE command because it assigned a column DEFAULT value, but corresponding table feature was not enabled. Please retry command again after executing ALTER TABLE table_name SET TBLPROPERTIES(#'delta.feature.allowColumnDefaults' = 'supported')

My understanding is that this CREATE TABLE is inside the box of

#enableChangeDataFeed feature, since adding metadata columns (https://docs.delta.io/latest/delta-change-data-feed.html#what-is-the-schema-for-the-change-data-feed) , so I was wondering is there a way to set required for this case properties (#'delta.feature.allowColumnDefaults' = 'supported')when reading and writing with Streaming queries.
I mean how to resolve missing property before streaming query starts if I am not creating or running CREATE TABLE statement for CDC table myself?