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] Error when updating Unity Catalog table #1175

Closed
ebarault opened this issue Mar 10, 2022 · 1 comment · Fixed by #1187
Closed

[ISSUE] Error when updating Unity Catalog table #1175

ebarault opened this issue Mar 10, 2022 · 1 comment · Fixed by #1187
Milestone

Comments

@ebarault
Copy link

ebarault commented Mar 10, 2022

Configuration

resource "databricks_table" "this" {
  name               = "test"

  ## uncomment next line to force update of the table on next apply
  # owner = "unity_admin"

  catalog_name       = "main"
  schema_name        = "default"
  
  table_type         = "MANAGED"
  data_source_format = "DELTA"

  column {
    name      = "id"
    position  = 0
    type_name = "INT"
    type_text = "int"
    type_json = "{\"name\":\"id\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}}"
  }
}

Expected Behavior

Updating a table should work

Actual Behavior

The provider returns the following error when trying to update the table:

error: cannot update table: UpdateTable invalid full_name_arg

databricks_table.this: Modifying... [id=main.default.test]
2022-03-10T23:54:50.634+0100 [INFO]  Starting apply for databricks_table.this
2022-03-10T23:54:50.634+0100 [DEBUG] databricks_table.this: applying the planned Update change
2022-03-10T23:54:50.635+0100 [INFO]  provider.terraform-provider-databricks_v0.5.2: Using directly configured basic authentication: timestamp=2022-03-10T23:54:50.634+0100
2022-03-10T23:54:50.635+0100 [INFO]  provider.terraform-provider-databricks_v0.5.2: Configured basic auth: host=https://***REDACTED***.cloud.databricks.com/, username=***REDACTED***, password=***REDACTED***, account_id=***REDACTED***: timestamp=2022-03-10T23:54:50.635+0100
2022-03-10T23:54:50.635+0100 [DEBUG] provider.terraform-provider-databricks_v0.5.2: PATCH /api/2.0/unity-catalog/tables/test {
2022-03-10T23:54:51.257+0100 [DEBUG] provider.terraform-provider-databricks_v0.5.2: 400 Bad Request {
2022-03-10T23:54:51.257+0100 [WARN]  provider.terraform-provider-databricks_v0.5.2: /api/2.0/unity-catalog/tables/test:400 - UpdateTable invalid full_name_arg.: timestamp=2022-03-10T23:54:51.257+0100
2022-03-10T23:54:51.257+0100 [WARN]  provider.terraform-provider-databricks_v0.5.2: /api/2.0/unity-catalog/tables/test:400 - UpdateTable invalid full_name_arg.: timestamp=2022-03-10T23:54:51.257+0100
2022-03-10T23:54:51.260+0100 [ERROR] vertex "databricks_table.this" error: cannot update table: UpdateTable invalid full_name_arg.
│   with databricks_table.this,
│   on main.tf line 65, in resource "databricks_table" "this":
│   65: resource "databricks_table" "this" {
path=.terraform/providers/registry.terraform.io/databrickslabs/databricks/0.5.2/darwin_arm64/terraform-provider-databricks_v0.5.2 pid=39212

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. perform any modification on the table, for example specifying an owner
  3. terraform apply

Terraform and provider versions

Databricks provider 0.5.2
Terraform 1.1.0

Debug Output

(provided above)

@ebarault ebarault changed the title [ISSUE] Unity Catalog Managed Delta table can be updated [ISSUE] Error when updating Unity Catalog Managed Delta table Mar 10, 2022
@ebarault
Copy link
Author

ebarault commented Mar 10, 2022

I believe the full id of the table main.default.test should be provided in the path of the PATCH query:

PATCH /api/2.0/unity-catalog/tables/main.default.test

instead of

PATCH /api/2.0/unity-catalog/tables/test

just as in the path of the DELETE query:

2022-03-11T00:31:25.375+0100 [INFO]  Starting apply for databricks_table.this
2022-03-11T00:31:25.375+0100 [DEBUG] databricks_table.this: applying the planned Delete change
2022-03-11T00:31:25.375+0100 [DEBUG] provider.terraform-provider-databricks_v0.5.2: DELETE /api/2.0/unity-catalog/tables/main.default.test

@ebarault ebarault changed the title [ISSUE] Error when updating Unity Catalog Managed Delta table [ISSUE] Error when updating Unity Catalog managed delta table Mar 10, 2022
@nfx nfx added this to the v0.5.3 milestone Mar 11, 2022
@ebarault ebarault changed the title [ISSUE] Error when updating Unity Catalog managed delta table [ISSUE] Error when updating Unity Catalog delta table Mar 11, 2022
@ebarault ebarault changed the title [ISSUE] Error when updating Unity Catalog delta table [ISSUE] Error when updating Unity Catalog table Mar 11, 2022
nfx added a commit that referenced this issue Mar 14, 2022
@nfx nfx closed this as completed in #1187 Mar 14, 2022
nfx added a commit that referenced this issue Mar 14, 2022
@nfx nfx mentioned this issue Mar 14, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this issue Feb 15, 2023
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

Successfully merging a pull request may close this issue.

2 participants