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

[FEATURE] Identity column specification on databricks_sql_table #3492

Open
Dedvall opened this issue Apr 19, 2024 · 0 comments
Open

[FEATURE] Identity column specification on databricks_sql_table #3492

Dedvall opened this issue Apr 19, 2024 · 0 comments
Labels
feature New feature or request

Comments

@Dedvall
Copy link

Dedvall commented Apr 19, 2024

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 Dedvall added the feature New feature or request label Apr 19, 2024
@Dedvall Dedvall changed the title [FEATURE] Identity column specification on databricks_sql_table [FEATURE] Identity column specification on databricks_sql_table Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant