Skip to content
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

Fixes #641 by using the svv_mv_info view which is queryable #647

Merged
merged 7 commits into from
Nov 29, 2023

Conversation

reptillicus
Copy link
Contributor

resolves #641

Problem

When doing a dbt run on a redshift serverless cluster, permission denied errors will happen when dbt attempts to query the svt_mv_info table. This is due to that table not being queryable by any user in redshift serverless as described here.

Solution

This can be remedied by a custom macro for redshift__describe_materialized_view, which references the svv_mv_info view instead of the svt_mv_info table as shown below

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@reptillicus reptillicus requested a review from a team as a code owner October 26, 2023 21:55
@cla-bot cla-bot bot added the cla:yes label Oct 26, 2023
@reptillicus reptillicus changed the title Hopefully fixes #641 by using the svv_mv_info view which is queryable… Fixes #641 by using the svv_mv_info view which is queryable Oct 26, 2023
@reptillicus
Copy link
Contributor Author

@dbeatty10 here's a wee little PR

@dbeatty10 dbeatty10 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Oct 26, 2023
@colin-rogers-dbt
Copy link
Contributor

@jiezhen-chen any reason we shouldn't use svv_mv_info?

@mikealfare
Copy link
Contributor

@jiezhen-chen any reason we shouldn't use svv_mv_info?

In particular, is there a reason to use svv_mv_info over stv_mv_info or vice versa? We want to make sure we're not trading one problem for another. On the surface these seem like very similar objects. I'd also like to stick a comment somewhere that explains why we're using one over the other so we don't accidentally revert this in the future.

@mikealfare mikealfare merged commit 058a3ff into dbt-labs:main Nov 29, 2023
13 checks passed
mikealfare pushed a commit that referenced this pull request Dec 1, 2023
* Hopefully fixes #641 by using the svv_mv_info view which is queryable in redshift-serverless

* Changelog entry

* Explain rationale in a comment to reduce possibility of an accidental reversion

---------

Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Mike Alfare <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>
(cherry picked from commit 058a3ff)
mikealfare added a commit that referenced this pull request Dec 1, 2023
)

* Hopefully fixes #641 by using the svv_mv_info view which is queryable in redshift-serverless

* Changelog entry

* Explain rationale in a comment to reduce possibility of an accidental reversion

---------

Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Mike Alfare <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>
(cherry picked from commit 058a3ff)

Co-authored-by: reptillicus <[email protected]>
mikealfare pushed a commit that referenced this pull request Dec 15, 2023
* Hopefully fixes #641 by using the svv_mv_info view which is queryable in redshift-serverless

* Changelog entry

* Explain rationale in a comment to reduce possibility of an accidental reversion

---------

Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Mike Alfare <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>

(cherry picked from commit 058a3ff)
mikealfare added a commit that referenced this pull request Dec 15, 2023
mikealfare added a commit that referenced this pull request Dec 15, 2023
…is queryable (#691)

* Fixes #641 by using the svv_mv_info view which is queryable (#647)

* Hopefully fixes #641 by using the svv_mv_info view which is queryable in redshift-serverless

* Changelog entry

* Explain rationale in a comment to reduce possibility of an accidental reversion

---------

Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Mike Alfare <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>

(cherry picked from commit 058a3ff)

* manually apply backported updates of #647 to macro that was moved between 1.6 and 1.7

---------

Co-authored-by: reptillicus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ok to test ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADAP-959] [Bug] macro describe_materialized_view does not work with redshift serverless
4 participants