Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] Issue with databricks_sql_table resource perpetual diff on options #4098

Open
apamildner opened this issue Oct 11, 2024 · 0 comments

Comments

@apamildner
Copy link

Configuration

resource "databricks_sql_table" "my_table" {
  name               = "foo"
  catalog_name       = "bar"
  schema_name        ="baz"
  table_type         = "EXTERNAL"
  storage_location   = "abfss://some-location"
  data_source_format = "JSON"
  options = {
    recursiveFileLookup = true
    multiLine           = true
  }
}

Expected Behavior

The options should be applied and not trigger a change on the next plan

Actual Behavior

We get a perpetual diff like this:

  ~ resource "databricks_sql_table" "my_table" {
      ~ effective_properties = {
          + "option.multiLine"                                = "true"
          + "option.recursiveFileLookup"                      = "true"
            # (2 unchanged elements hidden)
        }

Steps to Reproduce

  1. terraform apply
  2. terraform apply again
  3. Diff appears, even though we didn't change any code

Terraform and provider versions

Terraform version: 1.8.5
Provider version: 1.52

Is it a regression?

Yes, I think this is en edge case that wasn't covered by the great PR that solved a previous similar issue:
#3925
I would assume that since the options in this case end up like this in the state:

     "effective_properties": {
              "spark.sql.dataSourceOptions.multiLine": "true",
              "spark.sql.dataSourceOptions.recursiveFileLookup": "true"
            },

And not

     "effective_properties": {
              "options.multiLine": "true",
              "options.recursiveFileLookup": "true"
            },

we will get that diff. I think we need to handle the edge case where the options are of type spark.sql.dataSourceOptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant