dataform-co / dataform

Dataform is a framework for managing SQL based data operations in BigQuery
https://cloud.google.com/dataform/docs
Apache License 2.0
849 stars 160 forks source link

Support multiple unique key assertions #1029

Closed lewish closed 4 years ago

lewish commented 4 years ago

Currently only one combination of keys in a table can be used for a uniqueness assertion.

Extending the API here will require a breaking change, or a new option, perhaps uniqueKeys rather than uniqueKey.

config {
  assertions: {
    uniqueKeys: [
      ["a", "b"],
      ["d", "e"]
     ]
  }
}

That would allow specifying multiple combinations of fields that should each be unique.

rumbin commented 4 years ago

see also: https://dataform.canny.io/feature-requests/p/add-uniqueness-assertions

BenBirt commented 4 years ago

We actually used to have this API, but it was removed before we implemented the feature. Adding it back sounds good...