MaterializeInc / terraform-provider-materialize

A Terraform provider for Materialize
https://registry.terraform.io/providers/MaterializeInc/materialize
Mozilla Public License 2.0
11 stars 8 forks source link

Bug: using `map[text => text]` as type in `materialize_table` causes the table to be re-created each time #570

Open bobbyiliev opened 5 months ago

bobbyiliev commented 5 months ago

When using map[text => text] as type, the stored type in the state mismatches the actual type, causing the provider to try and re-create the table each time:

resource "materialize_table" "simple_table" {
  name          = "simple_table"
  schema_name   = "public"
  database_name = "materialize"
  comment       = "table comment"

  column {
    name = "column_1"
    type = "map[text => text]"
  }
}
benesch commented 5 months ago

Looks related to some stuff I was poking at in https://github.com/MaterializeInc/materialize/pull/27318.

@bobbyiliev: Materialize might just not report the information that you need in mz_columns to properly implement reads of the type property today. Will need to think about this one. I bet list types are broken in the same way.