diff --git a/.changes/unreleased/Fixes-20231026-164623.yaml b/.changes/unreleased/Fixes-20231026-164623.yaml new file mode 100644 index 000000000..f06eff381 --- /dev/null +++ b/.changes/unreleased/Fixes-20231026-164623.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix describe_materialized_view for Redshift Serverless +time: 2023-10-26T16:46:23.253837-06:00 +custom: + Author: reptillicus + Issue: "641" diff --git a/dbt/include/redshift/macros/materializations/materialized_view.sql b/dbt/include/redshift/macros/materializations/materialized_view.sql index 736eaacca..8317af9a4 100644 --- a/dbt/include/redshift/macros/materializations/materialized_view.sql +++ b/dbt/include/redshift/macros/materializations/materialized_view.sql @@ -76,9 +76,9 @@ tb.sortkey1, mv.autorefresh from svv_table_info tb - left join stv_mv_info mv - on mv.db_name = tb.database - and mv.schema = tb.schema + left join svv_mv_info mv + on mv.database_name = tb.database + and mv.schema_name = tb.schema and mv.name = tb.table where tb.table ilike '{{ relation.identifier }}' and tb.schema ilike '{{ relation.schema }}'