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

ADAP-973: Fix issue where materialized views were being mapped as views in catalog queries #653

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

mikealfare
Copy link
Contributor

resolves #652, dbt-labs/dbt-core#8864

Problem

Materialized views show up as views in catalog queries.

Solution

  • write a test demonstrating the issue
  • update the catalog query to correctly assign type for materialized views

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

Copy link
Contributor

@VersusFacit VersusFacit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit. Otherwise, straightforward. May want to leave a comment about the case-when being a short circuit operation though. The important of that precedence of checking the view is materialized first could be lost without that context somewhere.

@mikealfare
Copy link
Contributor Author

mikealfare commented Oct 31, 2023

One nit. Otherwise, straightforward. May want to leave a comment about the case-when being a short circuit operation though. The important of that precedence of checking the view is materialized first could be lost without that context somewhere.

That's a good point. I chose instead to add the condition in the case statement. Let me know what you think.

@mikealfare mikealfare merged commit 99c9d2a into main Nov 1, 2023
12 checks passed
@mikealfare mikealfare deleted the materialized-views/bug/adap-973 branch November 1, 2023 03:31
github-actions bot pushed a commit that referenced this pull request Nov 1, 2023
…ws in catalog queries (#653)

* changelog

* write test demonstrating the issue

* update the catalog query to identify materialized views

* explicitly state that materialized views have a relkind of v

(cherry picked from commit 99c9d2a)
github-actions bot pushed a commit that referenced this pull request Nov 1, 2023
…ws in catalog queries (#653)

* changelog

* write test demonstrating the issue

* update the catalog query to identify materialized views

* explicitly state that materialized views have a relkind of v

(cherry picked from commit 99c9d2a)
mikealfare added a commit that referenced this pull request Nov 1, 2023
…ws in catalog queries (#653) (#654)

* changelog

* write test demonstrating the issue

* update the catalog query to identify materialized views

* explicitly state that materialized views have a relkind of v

(cherry picked from commit 99c9d2a)

Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com>
mikealfare added a commit that referenced this pull request Nov 1, 2023
…ws in catalog queries (#653) (#655)

* changelog

* write test demonstrating the issue

* update the catalog query to identify materialized views

* explicitly state that materialized views have a relkind of v

(cherry picked from commit 99c9d2a)

Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants