-
Notifications
You must be signed in to change notification settings - Fork 59
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
[ADAP-961] [Bug] Materialized views that depend on other materialized views will fail to be refreshed due to drop not cascading #642
Comments
Thanks for trying out materialized views and sharing your experiences @jmeiring-sc ! I wasn't able to reproduce this upon my initial attempt. Could you try out the files that I have below and help me see what I need to change to get the same error as you?
{{ config(
materialized='table',
)
}}
select 1 as id
{{ config(
materialized='materialized_view',
on_configuration_change='apply',
)
}}
select * from {{ ref('my_model') }}
{{ config(
materialized='materialized_view',
on_configuration_change='apply',
)
}}
select * from {{ ref('parent_mv') }}
|
I believe that the configuration you have above will work fine as the base table
The first run will succeed, as there are no drops that need to happen. Subsequent runs will fail however:
|
Thanks @jmeiring-sc, that was exactly the insight we needed!
|
Also facing this issue. Attempted to solve with an on-run-start hook that looks for the
|
This is noted as a limitation in our documentation. This is because Redshift does not support drop cascade on materialized views which is a prerequisite for lifting this limitation. |
Re-opening as offline conversation with the Redshift team indicates we may be able to support this use case |
@colin-rogers-dbt any ETA on being able to get this supported? |
In conversations with the Redshift team - it looks like the pathway is to update the materialization to use |
Is this a new bug in dbt-redshift?
Current Behavior
If a materialized view (parent_mv) is based on another materialized view, a refresh of the the parent view that requires a full rebuild will fail as the
drop materialized view if exists parent_mv
does not cascadeExpected Behavior
Drop all dependent materialized views and recreate them
Steps To Reproduce
dbt run --full-refresh
Relevant log output
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: