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

[FEATURE] materialized views #1101

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jeremy-thomas-roc
Copy link

@jeremy-thomas-roc jeremy-thomas-roc commented Jul 1, 2024

resolves #870
docs dbt-labs/docs.getdbt.com/#

Problem

materialized views are currently not support for Snowflake. rather, dynamic tables were implemented, to be more consistent with other provider's concept of materialized views. however, there are still valid use cases for MVs, and so I figured it take a shot at implementing them.

Solution

this is my first attempt at contributing to dbt, so forgive me if this is not a great solution. i essentially reused the logic for views, with some minor changes to support the materialized version. i also added a check to the SnowflakeRelation object to see if a relation was an MV, for support within the macros.

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

@jeremy-thomas-roc jeremy-thomas-roc requested a review from a team as a code owner July 1, 2024 20:32
Copy link

cla-bot bot commented Jul 1, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @jeremy-thomas-roc

@jeremy-thomas-roc jeremy-thomas-roc marked this pull request as draft July 1, 2024 20:32
@jeremy-thomas-roc
Copy link
Author

as a note, i have not implemented testing, as left this in draft to make sure i am headed the right direction before diving into testing

@jeremy-thomas-roc
Copy link
Author

I have also signed the CLA now, apologies for doing that in the wrong order

@jeremy-thomas-roc jeremy-thomas-roc changed the title materialized view [FEATURE] materialized views Jul 2, 2024
@cla-bot cla-bot bot added the cla:yes label Jul 3, 2024
@jeremy-thomas-roc jeremy-thomas-roc marked this pull request as ready for review July 15, 2024 18:18
@cp-rohitdesai
Copy link

@dbt-labs/adapters team,
May we know when this PR will get merged and make this materialized view option available with dbt deployment in snowflake? Any estimated timeline or info on dbt version in which this will available will be helpful.
Though, I see some of githubs checks are still in queue.

@jeremy-thomas-roc
Copy link
Author

@mikealfare or any other maintainers: I would appreciate some initial review on this, even if it is not ready to go in its current state. I believe there is more testing, more edge cases, and other handling that could be implemented here, but without some feedback on the current state, I'm not sure how to proceed.

@BenoitLF
Copy link

Commenting as well to say that we would love to have this PR merged.
Who should we ask to have visibility ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADAP-1078] [Feature] Add Materialized View as a Materialization to dbt-snowflake
3 participants