Open wiatrak2 opened 1 week ago
there is a #4155 in progress - can you coordinate with that user to avoid duplications?
oh, indeed! I see the other user decided on slightly different approach to configuration of the constraint. And seems that the syntax is not compliant with Databricks SQL, maybe that's why there are some test failures. I will ask in that PR if we can somehow cooperate :)
otherwise, is there something I could do to proceed with the feature?
there is a #4155 in progress - can you coordinate with that user to avoid duplications?
seems the feature should be developed within this PR - I'm open to review and suggestions
Could you add functionality for the "RELY" optimization of Primary Keys?
ALTER TABLE customer ADD PRIMARY KEY (c_customer_sk) RELY
Sure, optional configuration of a constraint with RELY
added
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
Trigger: go/deco-tests-run/terraform
Inputs:
22bdf56ecbc89dd531962fb762a58212ecf0e6f2
Checks will be approved automatically on success.
Hi @tanmay-db
Thank you for your review. I adjusted the implementation to your comments:
CustomizeSchema
method - I misunderstood the functionality. Now, I decided to remove any entry for constraints
. If you have any suggestions - please let me knowserialize
functions to be part of ConstraintInfo
structerror
. Moreover, validation on constraint type during table creation allowed to implement the CHECK
type as well, that would be consistent do Databricks way of work - i.e. it's not allowed for CREATE TABLE
, but you can add it later.Please let me know what you think about these recent changes
@wiatrak2 there are CRUD APIs for PK/FK Table Constraints - https://docs.databricks.com/api/workspace/tableconstraints/create, does it make sense to have them as separate resources?
wdyt @tanmay-db ?
Changes
Hi!
I'd like to extend the
databricks_sql_table
resource with constraints feature.Within this pull request I extend the table's resource by allowing user to specify
PRIMARY KEY
andFOREIGN KEY
constraints. I haven't implemented theCHECK
constraint, as this one is more tricky and is not allowed during table creation - it can only be added later in the table's lifecycle. If the proposed changed are accepted, I can try to add the implementation forCHECK
, as well as cover other constraint options.I'm aware that the amount of implemented tests may not be satisfying. If this is the case - please let me know and guide my, what kind of tests should be added.
Tests
make test
run locallydocs/
folderinternal/acceptance