-
Notifications
You must be signed in to change notification settings - Fork 304
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
Primary keys may not be unique for variable length regexes #2116
Comments
@npatki Do we only need to check primary keys, or should this error for other ids that have regexes? |
@amontanez24 is there a reason why we should do this for other IDs? The problem we are trying to solve is that duplicate values may be generated from a regex. This is only an issue if the column is a primary key (or alternate key) right? |
I meant unique ids, so I guess alternate keys |
Got it! I updated the original issue text to include alternate keys as well. |
@npatki The issue includes the table name in the warning, but it would be kind of annoying to make that happen since at the point that the single table synthesizer gets fit, it doesn't know the table name. Is including the primary key name enough? |
Discussed today with @amontanez24. Ideally we include the table name because the primary key name is not unique enough to identify a table. Eg. I've seen schemas where all of the primary keys are just called |
Environment Details
Error Description
If a regex has variable length (eg. 3 or 4 characters long with a format such as
'[0-9]{3,4}'
), the primary keys that SDV generates may not always be unique. This is supported by the diagnostic report being less than 100%.Steps to reproduce
Output:
Expected Fix
This case can only happen when:
int
AND'0'
to be in the first position of the stringIf and only if all 3 conditions are met, the synthesizer should throw an error.
The text was updated successfully, but these errors were encountered: