-
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 fails if destination schema contains a MATERIALIZED VIEW in Snowflake #1430
Comments
Hey @adriank-convoy - thanks for the report! We have an open issue to support materialized views in Snowflake, but this is a smaller issue for sure. I think you're right, a quick fix for this is to add a new class attribute called I experimented with Snowflake's materialized views a couple of months ago, and they had some pretty serious limitations if I remember correctly. Are you using these in production? If so, I'd love to get your thoughts on #1162! |
Hey Drew, We have a single materialized view used by one of our services that's preventing us from upgrading to 0.13.0 =/. Right now it's created by a post-hook macro that runs every time the base model is full-refreshed due to https://docs.snowflake.net/manuals/user-guide/views-materialized.html#changes-to-base-tables, which seems to be a reasonable pattern for now I don't think we're in a rush to create more anytime soon, so I'll just try adding the MaterializedView type & send over a PR if it works |
Got it, ok, that would be great! |
Fixed in #1432, Thank you @adriank-convoy ! |
Issue
Issue description
dbt fails to compile or run when the destination schema contains a MATERIALIZED VIEW
Results
Run dbt compile, get
System information
The output of
dbt --version
: 0.13.0The operating system you're running on: OS X
The python version you're using (probably the output of
python --version
): 3.7Steps to reproduce
Run dbt when the destination schema contains a materialized view.
Cause
I believe the bug is caused by a combination of the snowflake__list_relations_without_caching macro https://github.com/fishtown-analytics/dbt/blob/027a0d2ee6d138b5c7ae05a0b20e511e6bfdf516/plugins/snowflake/dbt/include/snowflake/macros/adapters.sql#L53, which returns MATERIALIZED VIEW as the table_type:
and the list of acceptable relations in https://github.com/fishtown-analytics/dbt/blob/3f18b9398015e5c9e518ed43b344878e014c960c/core/dbt/adapters/base/relation.py.
The text was updated successfully, but these errors were encountered: