From 857bebe819483da389730af9139d76b8d30c477a Mon Sep 17 00:00:00 2001 From: Brandon Isom Date: Mon, 26 Oct 2020 18:29:47 -0700 Subject: [PATCH 1/4] Pushes the table_schema = '{{ relation.schema }}' clause down into the svv_external_columns CTE. --- plugins/redshift/dbt/include/redshift/macros/adapters.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/redshift/dbt/include/redshift/macros/adapters.sql b/plugins/redshift/dbt/include/redshift/macros/adapters.sql index a086bc1be84..1cd2557abdf 100644 --- a/plugins/redshift/dbt/include/redshift/macros/adapters.sql +++ b/plugins/redshift/dbt/include/redshift/macros/adapters.sql @@ -164,7 +164,8 @@ from pg_catalog.svv_external_columns where - tablename = '{{ relation.identifier }}' + schemaname = '{{ relation.schema }}' + and tablename = '{{ relation.identifier }}' ), From 2a5d090e91385152eaec8547d77ab64d887fc653 Mon Sep 17 00:00:00 2001 From: Brandon Isom Date: Mon, 26 Oct 2020 19:38:33 -0700 Subject: [PATCH 2/4] Pushes the `table_schema = '{{ relation.schema }}'` filter into the `svv_external_columns` CTE --- plugins/redshift/dbt/include/redshift/macros/adapters.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/redshift/dbt/include/redshift/macros/adapters.sql b/plugins/redshift/dbt/include/redshift/macros/adapters.sql index a086bc1be84..1cd2557abdf 100644 --- a/plugins/redshift/dbt/include/redshift/macros/adapters.sql +++ b/plugins/redshift/dbt/include/redshift/macros/adapters.sql @@ -164,7 +164,8 @@ from pg_catalog.svv_external_columns where - tablename = '{{ relation.identifier }}' + schemaname = '{{ relation.schema }}' + and tablename = '{{ relation.identifier }}' ), From eb34c0e46b002fb48350670b2f1c35b43148442f Mon Sep 17 00:00:00 2001 From: Brandon Isom Date: Mon, 26 Oct 2020 20:17:03 -0700 Subject: [PATCH 3/4] Add stuff to changelog per checklist --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cc73b137f..314a57b52b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Contributors: - [@feluelle](https://github.com/feluelle) ([#2841](https://github.com/fishtown-analytics/dbt/pull/2841)) - [ran-eh](https://github.com/ran-eh) [#2596](https://github.com/fishtown-analytics/dbt/pull/2596) - [@hochoy](https://github.com/hochoy) [#2851](https://github.com/fishtown-analytics/dbt/pull/2851) +- [@brangisom](https://github.com/brangisom) [#2855](https://github.com/fishtown-analytics/dbt/pull/2855) ## dbt 0.19.0b1 (October 21, 2020) @@ -34,6 +35,7 @@ Contributors: - Added strategy-specific validation to improve the relevancy of compilation errors for the `timestamp` and `check` snapshot strategies. (([#2787](https://github.com/fishtown-analytics/dbt/issues/2787), [#2791](https://github.com/fishtown-analytics/dbt/pull/2791)) - Changed rpc test timeouts to avoid locally run test failures ([#2803](https://github.com/fishtown-analytics/dbt/issues/2803),[#2804](https://github.com/fishtown-analytics/dbt/pull/2804)) - Added a debug_query on the base adapter that will allow plugin authors to create custom debug queries ([#2751](https://github.com/fishtown-analytics/dbt/issues/2751),[#2871](https://github.com/fishtown-analytics/dbt/pull/2817)) +- Fix Redshift adapter `get_columns_in_relation` macro to push schema filter down to the `svv_external_columns` view ([#2855](https://github.com/fishtown-analytics/dbt/issues/2854)) ### Docs - Add select/deselect option in DAG view dropups. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98), [docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138)) From 348a2f91ee322e7111c3cc2cb1b1d1f4bfc84fb0 Mon Sep 17 00:00:00 2001 From: Brandon Isom Date: Tue, 27 Oct 2020 11:17:13 -0700 Subject: [PATCH 4/4] Move a CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 314a57b52b9..87bbcfc9625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixes - Respect --project-dir in dbt clean command ([#2840](https://github.com/fishtown-analytics/dbt/issues/2840), [#2841](https://github.com/fishtown-analytics/dbt/pull/2841)) +- Fix Redshift adapter `get_columns_in_relation` macro to push schema filter down to the `svv_external_columns` view ([#2855](https://github.com/fishtown-analytics/dbt/issues/2854)) Contributors: - [@feluelle](https://github.com/feluelle) ([#2841](https://github.com/fishtown-analytics/dbt/pull/2841)) @@ -35,7 +36,6 @@ Contributors: - Added strategy-specific validation to improve the relevancy of compilation errors for the `timestamp` and `check` snapshot strategies. (([#2787](https://github.com/fishtown-analytics/dbt/issues/2787), [#2791](https://github.com/fishtown-analytics/dbt/pull/2791)) - Changed rpc test timeouts to avoid locally run test failures ([#2803](https://github.com/fishtown-analytics/dbt/issues/2803),[#2804](https://github.com/fishtown-analytics/dbt/pull/2804)) - Added a debug_query on the base adapter that will allow plugin authors to create custom debug queries ([#2751](https://github.com/fishtown-analytics/dbt/issues/2751),[#2871](https://github.com/fishtown-analytics/dbt/pull/2817)) -- Fix Redshift adapter `get_columns_in_relation` macro to push schema filter down to the `svv_external_columns` view ([#2855](https://github.com/fishtown-analytics/dbt/issues/2854)) ### Docs - Add select/deselect option in DAG view dropups. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98), [docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138))