terraform-provider-databricks
terraform-provider-databricks copied to clipboard
[ISSUE] Issue with `databricks_sql_table` resource
Configuration
resource "databricks_sql_table" "internal_orderbook_snapshots" {
name = "my_test_table"
catalog_name = "dev"
schema_name = "silver"
table_type = "MANAGED"
data_source_format = "DELTA"
column {
name = "bids_map"
type = "map<double, double>"
comment = "bid side of the orderbook as a map. key is price, value is quantity."
nullable = true
}
Expected Behavior
- Executing
terraform applyto create this table should create the table. - Subsequent
terraform planexecutions with no change in the table configuration should detect that nothing has changed and report no change.
Actual Behavior
- Executing
terraform applycreates this table when it does not exist, as expected. - Subsequent plans with no change in the table definition fail with the error message
Error: changing the 'type' of an existing column is not supported
with databricks_sql_table.orderbook_updates_table
on main.tf line 16, in resource "databricks_sql_table" "orderbook_updates_table":
resource "databricks_sql_table" "orderbook_updates_table" {
Steps to Reproduce
terraform applyterraform plan
Terraform and provider versions
Terraform [v1.9.5] databricks provider is 1.56.0
Is it a regression?
Version 1.52.0 has the same reported behaviour.
Debug Output
Important Factoids
Would you like to implement a fix?
Possibly, but will need some guidance ;)
Try doing a databricks tables get command in the databricks cli on that table and copy+paste your columns type_text into your terraform resource type field. I found that the type_text field for complex types like array<>, map<> and struct<> are unicode escaped in the type_text field but the comparison doesn't take it into account.