Moving an apply-time SQL error to a plan-time validation error, in a two-year-old issue.
Short answer
The materialize_source_kafka resource let you set format together with key_format , which Materialize does not accept, so terraform apply failed with a SQL syntax error. The fix adds ConflictsWith and RequiredWith rules to the schema, so Terraform rejects invalid combinations during plan. It was merged as PR #947 and closed issue #654 , which had been open since September 2024.
The problem
Issue #654 showed a Kafka source with both format { json = true } and key_format { json = true } . Applying it failed with:
Error : ERROR : Expected end of statement , found KEY ( SQLSTATE 42601 )
Enter fullscreen mode
Exit fullscreen mode
The issue already proposed the fix: add a ConflictsWith so format can't be combined with key_format and value_format .
The fix
"format" : func ( ) * schema . Schema { . . . s .…