-
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
dbt should not crash when it sees Materialized Views #1698
Comments
Thanks for the report @tomtl! I think we'll need to upgrade the introspective query that dbt runs to account for materialized views on PG. |
This would greatly help us - we have a ton of materialized views in our data warehouse and this is a blocker at the moment. Any suggested work arounds besides dropping the materialized views? |
I think the only workaround for the moment is to run dbt against a schema that does not contain any materialized views. A fix for this is going to be prioritized for dbt's next minor release. |
I can't reproduce this in 0.14.0 (nor 0.14.3, nor 0.15.0a1). I'm using Postgres 10.4 server, 11.2 client because that's what I have locally, and:
|
@beckjake I'm able to reproduce this with:
After running this sql, a
|
…l-materialized-views postgres: gracefully handle materialized views (#1698)
Describe the bug
When I run
dbt run
I get an error of "Cache inconsistency detected" referring to a materialized view in the same schema, not referenced in this DBT project, but part of a previous DBT project. Manually dropping the materialized view fixes the problem.Steps To Reproduce
Created a new DBT project that does not include mention of "cpp009_business_spend". Run
dbt run
. Get an error "dbt.exceptions.InternalException: Cache inconsistency detected: in add_link, referenced link key _ReferenceKey(database='reference', schema='tlee', identifier='cpp009_business_spend') not in cache!" (see below for full error). This was using DBT 0.13.1 installed with brew. I also updated to version 0.14.0 and got the same error.Using SQL to run
DROP MATERIALIZED VIEW tlee.cpp009_business_spend CASCADE;
fixes the problem and afterward DBT can run without any problems.Expected behavior
DBT should run without querying the "cpp009_business_spend" materialized view as it is not part of the DBT project.
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
DBT version 0.13.1 and 0.14.0 installed with Brew
Postgres 9.4
Mac OS current
The output of
dbt --version
:The output of
python --version
: Python 2.7.15Additional context
STACK TRACE
The text was updated successfully, but these errors were encountered: