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-1078] [Feature] Add Materialized View as a Materialization to dbt-snowflake #870

Open
3 tasks done
HRusby-Cheyne opened this issue Dec 20, 2023 · 11 comments
Open
3 tasks done
Labels
enhancement New feature or request materialized_views

Comments

@HRusby-Cheyne
Copy link

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt-snowflake functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Snowflake has an object type called Materialized Views. I'm aware that dbt-snowflake previously supported these and it was archived into the dbt-labs-experimental-features repo, I'm unsure as to why this logic was deprecated.

The Dbt Docs currently suggest using dynamic tables instead of materialized views in Snowflake, but having recently had a call with a Senior Snowflake Solutions Architect it was made apparent that dynamic tables aren't a replacement for materialized views and in fact, they are often used in combination (i.e. a materialized view may sit on top of a dynamic table). I have considered manually creating a materialised view outside of dbt however it would be much preferable to contain all of the DDL within the dbt project.

Describe alternatives you've considered

I've considered the following alternatives

  • Manually maintaining a materialised view outside of dbt
  • Creating a custom materialization, though this seems to be infeasible given that Materialized View isn't a RelationType defined in relation.py

Who will this benefit?

All Snowflake Users should find a benefit in having access to Materialized Views, it is often recommended as a performance improvement by Snwoflake Support

Are you interested in contributing this feature?

Happy to contribute though am not familiar with the dbt codebase

Anything else?

No response

@HRusby-Cheyne HRusby-Cheyne added enhancement New feature or request triage labels Dec 20, 2023
@github-actions github-actions bot changed the title [Feature] Add Materialized View as a Materialization to dbt-snowflake [ADAP-1078] [Feature] Add Materialized View as a Materialization to dbt-snowflake Dec 20, 2023
@jeremy-thomas-roc
Copy link

I'd like to second this feature request. Specifically, materialized views are the Snowflake recommended approach to query large external tables, a gap in which dynamic tables cannot bridge.

@amychen1776
Copy link

amychen1776 commented Jun 28, 2024

@jeremy-thomas-roc Thank you for your comment. We have confirmed with Snowflake that that is no longer the recommendation: Iceberg tables are the recommended way to query and manage large external tables.

@jeremy-thomas-roc
Copy link

@amychen1776 their official documentation seems to contradict that:
https://docs.snowflake.com/en/user-guide/views-materialized#deciding-when-to-create-a-materialized-view

also, Iceberg tables are a larger technical lift than a materialized view, especially for smaller teams or single use. it seems prudent that dbt be able to support the "next best" option, if they do indeed recommend Iceberg going forward.

if it's a prioritization issue, I would be open to contributing, as I may end up creating this materialization for our team anyway.

@amychen1776
Copy link

@jeremy-thomas-roc Thank you! I just let the Engineering team know and see if they can update their documentation with the new recommendation. We always welcome external PRs from the community :)

@jeremy-thomas-roc
Copy link

@amychen1776 i opened a draft PR to get some feedback on my direction, hopefully this will help!

@BenoitLF
Copy link

Thanks @jeremy-thomas-roc !

@cp-rohitdesai
Copy link

Thanks @jeremy-thomas-roc !

@amychen1776
May we know when the PR#1101 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.

@CM000n
Copy link

CM000n commented Aug 14, 2024

@jeremy-thomas-roc Thank you for your comment. We have confirmed with Snowflake that that is no longer the recommendation: Iceberg tables are the recommended way to query and manage large external tables.

Iceberg tables in their current state cannot replace the simplicity of external tables in conjunction with materialized views!

Many companies, like us, still have a need for partition management to be done at the file system level, by tools outside of Snowflake.
This is not possible with Iceberg Tables that use a metadata catalog managed by Snwoflake. And for Iceberg Tables with a 3rd party data catalog it is only possible with additional management overhead.
We would therefore also welcome the support of Materialized Views.

@amychen1776
Copy link

amychen1776 commented Oct 29, 2024

Thank you @CM000n for the input - I understand the use case.

As an update, unfortunately, MVs for Snowflake are not on our roadmap for the next quarter. I will revisit this next quarter and will be happy to update if things change here.

@jeremy-thomas-roc I appreciate the work you have done with the associated PR and it was very helpful in better understanding the scope/impact (and giving us a meaningful leg up for when we can pick this up).

@BenoitLF
Copy link

Thanks for the answer @amychen1776.
What do you mean by next quarter ? Can we expect to hear from you beginning of 2025 ?

@amychen1776
Copy link

Our new quarter starts in February, but I want to be mindful about making promises I can't keep. I (or anyone related to my team) will update this issue when we make the decision to prioritize supporting Materialized Views. This does not mean a check in every quarter to say hey this is not supported for x quarter. That said - for anyone coming across this issue, please continue to thumbs up the OP because this is a simple way to show us that this is desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request materialized_views
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants