terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[ISSUE] Issue with `databricks_sql_table` resource

Open mahmoud-masmoudi-dev opened this issue 1 year ago • 5 comments

Issue with databricks_sql_table resource. The "warehouse_id" seems to be ignored, and Terraform is always creating a special cluster "terraform-sql-table" for CRUD operations.

Configuration

resource "databricks_sql_table" "this" {
  provider           = databricks.dataengineer
  name               = var.table
  catalog_name       = var.catalog
  schema_name        = var.schema
  table_type         = "EXTERNAL"
  data_source_format = "DELTA"
  storage_location   = var.location

  comment = var.comment

  warehouse_id = "893a0ff662ac09de"
}

Expected Behavior

I expected terraform/databricks to use the specified warehouse to create the databricks_sql_table resources

Actual Behavior

terraform/databricks is always creating a cluster "terraform-sql-table" and ignoring the specified warehouse. Even the plan shows that terraform is generating a "cluster_id", even though, warehouse_id is explicitely specified

module.external_delta_table["bronze_gtfs_trips"].databricks_sql_table.this will be created

  • resource "databricks_sql_table" "this" {
    • catalog_name = "<my_catalog>"
    • cluster_id = (known after apply)
    • comment = ""
    • data_source_format = "DELTA"
    • id = (known after apply)
    • name = "bronze_gtfs_trips"
    • properties = (known after apply)
    • schema_name = "<my_schema>"
    • storage_location = "<s3_storage_location>"
    • table_type = "EXTERNAL"
    • warehouse_id = "893a0ff662ac09de" }

Steps to Reproduce

  1. terraform apply

Terraform and provider versions

Terraform v1.6.5 on linux_amd64

  • provider registry.terraform.io/databricks/databricks v1.30.0
  • provider registry.terraform.io/hashicorp/aws v5.29.0
  • provider registry.terraform.io/hashicorp/null v3.2.2

mahmoud-masmoudi-dev avatar Dec 04 '23 15:12 mahmoud-masmoudi-dev

@mahmoud-masmoudi-dev could you share debug logs per the template so we could investigate further?

nkvuong avatar Dec 08 '23 16:12 nkvuong

This is the same behavior for us. The warehouse_id or cluster_id field is just ignored and a default cluster "terraform-sql-table" is created always in a never-ending loop. Please upvote this issue and help get resolved.

soujyosen avatar Dec 22 '23 03:12 soujyosen

Having the same issue here.

CarreauClement avatar Feb 05 '24 14:02 CarreauClement