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

Closed

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 ?

@BenoitLF
Copy link

@mikealfare maybe ?

@jeremy-thomas-roc
Copy link
Author

@mikealfare Can we get some indication of the priority of this at least? I understand that it is a large implementation step, but radio silence from maintainers is frustrating. I'm happy to put in more time working on this, our current workaround is sub-optimal at best and I'd be happy to contribute to help others as well.

@amychen1776
Copy link

amychen1776 commented Oct 29, 2024

Hi folks! I'm Amy - I'm the Product Manager for the Adapters team.
First, I want to say that I very much appreciate the work that @jeremy-thomas-roc have done here. Community contributions and discussions are always meaningful, and that's part of what makes great open-source software.

In terms of tagging and communication - I'm the one responsible for triaging and defining scope. Feel free to tag me or just simply chat with me in dbt Slack (I monitor it at least once a week). :) No need to tag our engineers for things like this (especially since they are not responsible for assigning work). Please also note that I am one person, and we have multiple repositories to oversee.

That said, this PR is super helpful in helping us scope out and get a head start for supporting MVs in dbt-snowflake. Unfortunately, MVs for Snowflake are not on our roadmap for the next quarter and thus, we are not able to merge in the PR and thus establishing continous dbt support/maintainership for MVs. I will revisit this next quarter and will be happy to update if things change on the associated issue.

@jeremy-thomas-roc
Copy link
Author

@amychen1776

Hi folks! I'm Amy - I'm the Product Manager for the Adapters team. First, I want to say that I very much appreciate the work that @jeremy-thomas-roc have done here. Community contributions and discussions are always meaningful, and that's part of what makes great open-source software.

In terms of tagging and communication - I'm the one responsible for triaging and defining scope. Feel free to tag me or just simply chat with me in dbt Slack (I monitor it at least once a week). :) No need to tag our engineers for things like this (especially since they are not responsible for assigning work). Please also note that I am one person, and we have multiple repositories to oversee.

That said, this PR is super helpful in helping us scope out and get a head start for supporting MVs in dbt-snowflake. Unfortunately, MVs for Snowflake are not on our roadmap for the next quarter and thus, we are not able to merge in the PR and thus establishing continous dbt support/maintainership for MVs. I will revisit this next quarter and will be happy to update if things change on the associated issue.

Thank you for providing some insight. Apologies for tagging Mike, he seemed like the most active person in the repo and the most likely to provide an answer.

Obviously, there isn't much we can do but hope it appears on the roadmap, but hopefully the fact that there are multiple people asking about this feature can help push it in the right direction.

I'm closing this PR based on your comment, and can reopen if it is on the horizon.

@amychen1776
Copy link

No worries! I totally understand - it's not always very clear who to tag (which I feel like we can figure out improvements there). And to emphasize again, we truly appreciate the work you did here!

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
4 participants