Primary key in editable dataset
Hi DSS Team,
I created an editable dataset in Dataiku and I want to make a column as a primary key i.e. the values in that column should be unique and not NULL/empty. Is there a way to enforce that in Dataiku?
Regards,
Shubham
Answers
-
Hi,
DSS doesn't offer anything like constraints on the data, especially on editable datasets which are totally free-form tabular data.
If you need a constraint checked on a dataset built by DSS (so this doesn't apply to datasets that are inputs to your flow, like editable datasets usually are), you can write a custom check on a column to raise an error if there are null values, or if the count of distinct values is not as expected.
The easiest to have a constraint applied is to copy the data to a SQL table in some database, using a Sync recipe. If you have put a unicity or non-nullity constraint on that table, then the copy will only pass if the constraints are met.