-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-964] [Regression] Truncate relation names when appending a suffix is creating cache inconsistency #5586
Comments
@tlfbrito Thanks for opening! You've identified the right root cause. We implemented smarter logic for handling relation name truncation on Postgres. Because the Here's the relevant macro logic: dbt-core/plugins/postgres/dbt/include/postgres/macros/adapters.sql Lines 142 to 157 in 26ac9d5
Redshift allows relation names up to 127 characters (docs), so it doesn't require the same complex handling at the 63-character mark. Potential solutions:
Then, we should add a test for this: two models with >63 character names, where the first 63 characters are identical. |
@jtcohen6 I am working currently on the solution number two (Copy-paste |
Merge completed. We had "local" and CI tests reporting success. If you want to use the fix, point your adapters at repo HEAD. |
I just tested this with dbt 1.2.1RC1 and I'm seeing the same error:
both dbt-core and dbt-redshift are |
@Limess Thanks for testing and following up so quickly! I'll reopen this so we can keep working. It sounds like you have two models with similar names which are colliding. Is it these?
I'm surprised to hear there's a collision between those two, since their first 51 characters are different. This should work even without the Redshift macro override that we included in |
Yep, there are 4 models like this within the project:
|
Ah, the issue is that while dbt-labs/dbt-redshift#149 reimplemented
I think we can do that quite simply, within the @VersusFacit Code I was using to test out this fix locally: |
We haven't seen any errors since deploying rc2 the day it was released |
Is this a regression in a recent version of dbt-core?
Current Behavior
We have a few models with long and similar names, for example:
After updating to DBT 1.2 we started to see the following error:
Cache inconsistency detected: in rename, new key
It that
v1.2
is truncating both of the table identifiers to "identifier='shipping_group_configurations__path_groups_and_sett__dbt_backup'" probably due to #4921Expected/Previous Behavior
In the 1.1 version this truncate did not happen.
Steps To Reproduce
Create two models with more than 63 characters in the name with a common prefix name.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered: