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

[FEATURE] Identity column specification on `databricks_sql_table`

Open Dedvall opened this issue 10 months ago • 2 comments

Use-cases

Be able to define Identity column on a table the databricks_sql_table needs some means to define identity columns. After the release of provider version 1.40 it seems impossible to create a table with an Identity column (Issue #3490)

The Identity column options documented here needs to be possible in Terraform too.

Attempted Solutions

Until provider version 1.40 this was possible

resource "databricks_sql_table" "table_foo" {
  name               = "foo"
  catalog_name       = databricks_catalog.main.name
  schema_name        = databricks_schema.main.name
  table_type         = "MANAGED"
  data_source_format = "DELTA"

  column {
    name     = "bar"
    type     = "bigint GENERATED BY DEFAULT AS IDENTITY"
    nullable = "false"
  }

After that provider version above fails with errors on plan. As #3490

Proposal

Something similar to this could be possible

resource "databricks_sql_table" "table_foo" {
  name               = "foo"
  catalog_name       = databricks_catalog.main.name
  schema_name        = databricks_schema.main.name
  table_type         = "MANAGED"
  data_source_format = "DELTA"

  column {
    name     = "bar"
    type     = "bigint "
    nullable = "false"
    identity = "default" // possible values FALSE (default) & ALWAYS
  }

References

#3490 SQL Reference Identity release blog

Dedvall avatar Apr 19 '24 13:04 Dedvall

I would also appreciate that feature

aru-trackunit avatar Jun 12 '24 11:06 aru-trackunit

Resolved in #4035

hshahconsulting avatar Sep 30 '24 17:09 hshahconsulting