-
Notifications
You must be signed in to change notification settings - Fork 398
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] Support for identity column in sql table #3709
[Feature] Support for identity column in sql table #3709
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hshahconsulting
Thanks for this contribution. I looks quite good. I left a couple of comment.
@edwardfeng-db Can you also take a look at this PR?
@hectorcast-db I have made the changes according to the feedback. Anything else that needs to be done? Also, @tanmay-db said that other changes may be needed. Any follow up on that? |
Hi @hshahconsulting, thanks for creating the PR. Can you please check if this works locally for you? You can create a local binary to test: https://github.com/databricks/terraform-provider-databricks/blob/main/CONTRIBUTING.md#developing-provider So the steps would be to:
Note: Please use dev environment / test data for this (just in case there are some issues). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some issue in the list of commits. It seems that this PR is changing preexisting commits. Can you take a look at it?
I made a mistake with a previous rebase. The branch has now been cleaned up. |
I am trying to run this locally but I cannot stop it from downloading the terraform provider from the internet. We have a version.tf with this code
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content looks good.
I just saw that there are issues with the git history again. Can you fix that? Then we can run the automatic workflows and merge.
I am not sure what the issue is this time. I created this branch from main and then pasted in the code. Which commit is bad? |
Please check again @hectorcast-db |
I did run all integration tests and this changes causes some issues related to the usage of the
Making the default an empty string should solve both issues. |
Is this correct?
I have never coded in Go Lang before so please excuse my beginner level questions hehe :D |
Please check. I have set the default to empty string. |
@hectorcast-db Sorry for bumping but anything else needs fixing? |
Tests just finished, and there is still one issue. However, I don't know the API well enough to recommend a solution. I have contacted the service team and I am waiting for a response. I will describe the issue in case you know how to fix it: The new test you added is failing. Terraform always reads the server data after an apply, and then validates that there is no diff between the server status and the local status. However, the server does not return the Identity, so there is always a diff. We need to be able to reconstruct the "Identity" value inside the READ method based on the server response. |
I see. Appreciate the help! |
@hectorcast-db Hello Hector. Do you have any news regarding the Service Team planning to take a look at this? |
Hi @hshahconsulting |
@hectorcast-db thanks. Could you paste the logs from the latest run of the integration tests where this fails, after I set the default value for the identity to an empty string? Perhaps I could figure something out by looking at it. |
Duplicate of #4035 |
Changes
As Databricks supports identity columns, I have added support for identity columns in databricks_sql_table.
Closes [FEATURE] Identity column specification on databricks_sql_table
Tests
added unit test that asserts a correct statement has been generated when an identity column type is specifiedmake test
run locallydocs/
folder