You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding constraints to our project we've discovered some datatype inconsistencies within our models.
For example in a fact table we specify the customer_key as varchar and in the dimension as varchar(50). By default Snowflake will create the fact table with varchar(16777216) which obviously is not the same as varchar(50).
Upon running the dbt build every test passes. But in the post hook when actually creating the constraints Snowflake will return the database error that keys are not matching.
When running with multiple threads its very hard to figure out which constraint has failed to build.
There's a couple of solutions to help finding the cause of the error:
When the database error occurs also log which constraint is causing it
When a foreign key is specified not only test the existence of the key, but also check the data type and fail / warn if there's a mismatch.
The text was updated successfully, but these errors were encountered:
When adding constraints to our project we've discovered some datatype inconsistencies within our models.
For example in a fact table we specify the customer_key as varchar and in the dimension as
varchar(50)
. By default Snowflake will create the fact table withvarchar(16777216)
which obviously is not the same asvarchar(50)
.Upon running the
dbt build
every test passes. But in the post hook when actually creating the constraints Snowflake will return the database error that keys are not matching.When running with multiple threads its very hard to figure out which constraint has failed to build.
There's a couple of solutions to help finding the cause of the error:
The text was updated successfully, but these errors were encountered: